Skip to content
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.Flowcharts is retired. Current docs
Get Free Trial
Sahi Pro Flowcharts is retired. These pages document the last release (v12) and are no longer updated. Go to the current documentation.

Variable Templates

Variable Templates allow the user to reference variable values in string parameters. During execution of the flow, the referenced variable will be resolved and replaced with its current value. This allows the user to focus on the form of input, instead of worrying about correct syntax for concatenating variables in parameters.

  • Values of a field can be generated with a combination of some variable values provided at RUN and Data Generator parameters.
  1. Open the User Registration flowchart.

  2. Click on Run and go to Advanced Run Settings

  3. Type the External Variable for firstname and lastname.

    External Variable for firstname and lastname

  4. Close Advanced Run Settings window and open Automate dialog

  5. On the Automate dialog, go to Entities tab and go to Data Generator sub-tab.

  6. Select the firstname attribute and set the prefix to {{var_firstname}}. The generated value can be seen in the Preview box.

    Firstname using External Variable

  7. Select the lastname attribute and set the prefix to {{var_lastname}}. The generated value can be seen in the Preview box.

    Firstname using External Variable

Example 2: Generating email based on other values

Section titled “Example 2: Generating email based on other values”
  • Values of a field can be generated with a combination of values already generated through Data Generator.
  1. Go to Data Generator sub-tab and select email attribute

  2. Set the names to {{$this.firstname}}.{{$this.lastname}}. The generated value can be seen in the Preview box.

    Email using variable template to use generated values

  1. In Entity tab of Automate dialog, the UI Element can be a variable reference. This variable value can be provided at runtime through Advanced Run Settings

    Variable template in Entity

  2. In Screen tab of Automate dialog, the UI Element can be a variable reference. This variable value can be provided at runtime through Advanced Run Settings

    Variable template in Screen

  • The Variable Template for email generation can also be provided through the Edit Step dialog.
  1. Open the User Registration flowchart.

  2. On Automation dialog, under Keywords tab, select Enter $user details keyword.

  3. Double click on the step Set Value for Email Input to edit the step.

  4. Select the Element parameter type as JS Code and fill the UI Element in the textbox.

    [The UI Element can be taken from the Entities tab.]

  5. Select String type for the Value parameter.

  6. Type the concatenation string in the Value parameter textbox.
    {{$user.firstname}}.{{$user.lastname}}@example.com

    Type the concatenation string in the Value

  7. Click on Update button.

  8. The step for email attribute gets updated with the new parameters.

    Updated step for email attribute

  9. Click on Save Keyword

  10. Run the flow. It generates random firstname, lastname and generates the email by concatenating both along with the provided domain.

    Output email generated after performing concatenation

  • The Variable Template for REST API Call can also be provided through the Body as Raw.
  1. Open the User Registration flowchart.

  2. On Automation dialog, under Keywords tab, select Enter $user details keyword.

  3. Add step REST API Call with Body as raw.

  4. Fill up the relevant field with all required information.

  5. Select Body as Raw.

  6. Pass Variable Template in Raw textarea.

    {
    "title":"{{$post.name}}",
    "dueDate":"2024-12-18T12:51:54.969Z",
    "completed":{{$post.comp}}
    "From": "whatsapp:+{{$creatio.phoneNumber}}"
    }

    REST API call

  7. Click on Update button.

  8. The REST API Call step’s body is updated with variable template.

  9. Click on Save Keyword

  10. Run the flow. It will send a REST API Call with the Body value as Variable Template value.

  • The values for an attribute can be passed externally by providing key value.
  1. On the User Registration flowchart, open the Automate dialog.

  2. Click on Run button and go to Advanced Run Settings section.

  3. In the External Variables textbox, type email=simple@example.com.
    The format used here is key=value

    Type External Variables value in

  4. Go to the Edit Step dialog for email attribute

  5. Let theElement type as JS Code.

  6. Let the Value parameter type be String.

  7. Type {{$email}} in the Value parameter textbox.

    Type the concatenation string in the Value

  8. The step for email attribute gets updated with the new parameters.

    Updated step for email attribute

  9. Click onRun. It will use the email same as defined under External Variables

    Email is generated through External Variables