To assign a value to a variable while a rule set is executing, you must use the Set Variables action. From within an instance of the action, you can assign multiple variable values at once.
You must create the variable before you can assign a value to it.
- To set a value, add a Set Variables action to the rule chain.
- Edit the action parameters and specify the variables to be set. Use the Add Field button to add additional variables. For each variable specify the property reference or expression that should be used to obtain the value for the variable.
As with all action parameters, the value of a variable can be specified either by assigning it directly or including it in an expression as seen in the example below for the Jobs Created Count rule set variable. In this example, the current value of Jobs Created Count is incremented by one and assigned back to the variable.
The variables are locked for the duration of the action and variable values are always retrieved and updated in the same order to avoid any concurrency issues.