Integration Procedures (IPs) in Salesforce Industries are used to process data efficiently without writing code. One of the most commonly used elements inside an Integration Procedure is SetValues. It allows you to manipulate, merge, calculate, and transform data before sending it to the output or another system.
In this article, we will learn how to use SetValues in an Integration Procedure, how to merge element values, perform calculations, concatenate fields, and finally display the result using Response Action.
What Is SetValues in Integration Procedure?
SetValues is an element in Integration Procedure that allows you to:
- Assign static values
- Merge values from different elements
- Perform calculations using formulas
- Concatenate multiple fields
- Retrieve values from arrays or lists
It helps prepare and structure data in the required format before sending it to OmniScript, FlexCard, or an external system.
Use Case of SetValues
SetValues is commonly used when:
- You need to combine multiple input fields
- You want to format output data
- Calculations are required without Apex
- Data needs to be reused in another SetValues
- Final output must be shown in Preview or Response
Step 1: Create an Integration Procedure
The first step is to create an Integration Procedure.
Steps:
- Go to Setup.
- Search for Integration Procedure.
- Click New.
- Enter required details such as:
- Name
- Type
- Subtype
- Language
- Name
- Save the Integration Procedure.
Once created, open it in Designer mode.
Step 2: Add SetValues to the Structure Panel
Now, add the SetValues element to the Integration Procedure.
Steps:
- Open the Structure Panel.
- Drag and drop SetValues into the Integration Procedure flow.
- Rename it meaningfully (for example: SetValues_1).
This SetValues element will be used to define and manipulate data values.
Step 3: Configure Element Value Mapping
Inside SetValues, you define how values are assigned or merged.
Element Value Map Configuration:
- Click on the SetValues element.
- Go to the Element Value Map section.
- Click Add New Value.
- Define:
- Element Name (output variable)
- Value (static value, merge field, or formula)
- Element Name (output variable)
This mapping helps transfer data from input JSON or other elements into new variables.
Step 4: Perform Operations Using SetValues
SetValues supports multiple operations that can be performed easily.
Common Operations in SetValues
Merge Fields
You can merge values from input or previous elements using merge syntax.
Example:
%Input:FirstName%
Calculations Using Formulas
You can perform mathematical operations like addition or multiplication.
Example:
%Input:Price% * %Input:Quantity%
Concatenate Two Merge Fields
You can combine multiple fields into one value.
Example:
%Input:FirstName% %Input:LastName%
Retrieving an Array Value
You can access values from an array using index-based notation.
Example:
%Input:Items[0].Name%
These features allow you to handle complex logic without writing Apex code.
Step 5: Configure a Second SetValues for Concatenation
In many cases, one SetValues depends on values created in another SetValues.
Steps:
- Drag and drop another SetValues element.
- Rename it (for example: SetValues_2).
- In the Element Value Map:
- Reference values created in the first SetValues
- Concatenate or manipulate them as needed
- Reference values created in the first SetValues
Example:
%SetValues_1:FullName% – %SetValues_1:TotalAmount%
This shows how data can flow from one SetValues element to another.
Step 6: Add Response Action to Display Output
To display the output data in the Preview Tab, you must use Response Action.
Steps:
- Drag Response Action into the Structure Panel.
- Configure it to return the required data nodes.
- Map the values created in SetValues to the Response Action output.
Without Response Action, the output will not be visible during execution.
Step 7: Execute and View Results in Preview Tab
After completing the configuration:
Steps:
- Click Validate to ensure there are no errors.
- Click Activate.
- Click Execute.
- Go to the Preview Tab.
You will now see:
- Merged values
- Calculated results
- Concatenated fields
- Final output structure
This confirms that SetValues and Response Action are working correctly.
Best Practices for Using SetValues
- Use meaningful names for SetValues elements
- Avoid complex logic in a single SetValues
- Chain SetValues for better readability
- Always use Response Action for output visibility
- Validate and test with sample input data
Conclusion
SetValues is a powerful and essential component of Integration Procedures in Salesforce Industries. It allows you to merge, calculate, concatenate, and transform data without writing Apex code. By combining multiple SetValues and using Response Action, you can efficiently control the data flow and output of your Integration Procedure.
Mastering SetValues helps you build scalable, reusable, and maintainable integrations that work seamlessly with OmniScripts and FlexCards.
