Illustrated in the below image is an example of a flow of how the Condition Control step is used.
The condition is set to whether a sale can get a commission if the total is greater than 500. The two condition subflows are used to determine this and send the required data to Salesforce and save the remaining data to a buffer. One has an amount that is greater than 500 and the other has less.
A Buffer source step is used to start the flow. The image below shows the data in the Buffer source step.
Adding the Condition Control step
To add a Condition Control step in a flow, follow the below instructions:
1. Click on the highlighted icon as shown in the below image.
2. The below page will appear. Select or search for a Control step. Click on the Control tab and select Condition as shown in the image below.
Configuring a Condition Control step
Provide a title and description (optional). Once saved, open the control step to access more configuration options as shown in the image below.
The Swap Control Step is used to swap to another Control step. The Condition Control step can be swapped with the Parallel or Series Control steps.
Using the Condition Control Step
To add a Subflow in the Condition step, click on the plus icon shown in the below image. A Subflow will be added with each click. To set a condition, click on the highlighted button in the image below.
The below page will appear. The Break on Error checkbox will break on any errors in the Subflow when selected. The Record by Reference section checkbox will pass the record by reference instead of creating a copy when selected. Type in the Condition field to set the conditions for each Subflow as illustrated.
Illustrated in the below image is the Calculator step for the first Subflow, which is with commission added.
The below image shows the Calculator step for the second Subflow, which is with no commission.
The Return Value can be set by clicking on the icon shown in the image below. For more information on Return Value, see the Additional Information section at the bottom of the page.
A “commission” field will be added to the record as shown in the image below.
The image below shows the outcome after the Condition step. The commission has been added and it shows whether a commission was added or not.
Additional information
Returns
The options below let you define how you want the data to be returned from the Sub-flow. To access Returns, click on the Returns button as shown illustrated in the image below.
Return Type
Select the option type you want the Sub-flow value to be returned as one of the following:
None - No return. This is equivalent to void in traditional programming
Current - The default of the subflow being called
Array - Converts the output to an array.
Object - Converts the output to an object.
String - Converts the output to a string.
Binary - Converts the output to a binary representation.
Base64 - Converts the output to base64.
Return Source
Selects what value types to return from the flow you are calling.
Auto - Auto detects the appropriate output.
Record - Returns the current record processed by the subflow.
Output - Returns the output of the Writer Step (if any) in the subflow.
Result - Returns the output of the Destination Step (if any) in the subflow.