Referencing flow variables in a process flow
Last updated
Last updated
The steps required to reference flow variables in a process flow can be summarised in two stages:
Any flow variables that you want to reference from process flow shapes should be added as variables within the process flow settings. To do this, follow the steps below.
Step 1 Access the process flow that you want to update and .
Step 2 Select settings (the cog icon) from the actions bar:
Step 3 Look for the variables section in the flow settings panel - for example:
Step 4 Click the add new variable button:
Step 5
In the name field, enter the name (i.e. the API parameter name) of this variable. For our example, the variable is named customerID
:
Step 6 Click in the select a type field and select the data type for this variable:
Step 7 Enter the required value to be used wherever this variable is found in the process flow - for example:
Step 8 Add all required flow variables in the same way, then save changes.
Having defined your required flow variables, they can be referenced throughout the system - for example, in scripts or as variable values.
The example below shows how this works. A GET single order
endpoint has been configured to expect a customerID
variable, and then how this variable is surfaced in connection shape settings when this endpoint is used:
Step 1 In your process flow, access settings for the connection shape that you want to update with a flow variable:
Step 2 Look for the variables section in the settings panel - for example:
Step 3 Use the syntax below to reference a flow variable:
Step 4 Save changes. Now when this process flow runs, the value defined in process flow settings will be passed in for this variable.
We could define a static value here; , or reference an existing flow variable. The steps below show how to reference a flow variable.
You can also reference flow variables in (which means you can manipulate these values however you need) and also in .
To use a flow variable here, the expected variable must correlate with a variable that you added in . Notice that the example above is expecting a Customer ID variable, which correlates with the customerID
flow variable that we added in step 5 of .
...where the variable
element should be replaced with the name of the flow variable defined in process flow settings (). Using our example, this would be:
Flow variable values can also be updated by custom scripts. For further information please see .