Updates a given variable

Use this step to update workflow variables with user defined values.

Last published at: July 26th, 2023

updateVariable Step

Description:

This step updates a workflow variable/variables with user defined values.

Inputs

  • variableName – name of the variable to update
  • variableValue – value of the variable
  • updateVariables – update multiple variables with values 
  • hasExpression – has expression (Yes/No). Consider the data as expression for YES and the data by itself for NO configuration  
 

 

Returns

  • True –variable updated successfully
  • False – variable not updated 
 

 

Usage:

 

 

Example:

Let’s build and execute the “updateVariableDef” example.          

  • Create a new definition called “updateVariableDef” 
  • Select the definition and click the “design” button
  • Drag the above controls from the toolbox and connect as shown above
  • Define a variable to store the result after execution
  • Click on the "updateVariable" step to configure its "Settings" properties. Provide a name to the step. 
  • Click on the "updateVariable" step to configure its "Advanced" properties. Provide the single variable reference and value. 
  • Click on the button to update multiple variables with values. Provide the variable reference and values. Configure “Yes” if the value to be computed is an expression. Note : Use either single variable references or multiple and, not both.  
  • Expression Builder Utility. Click inside the textbox. Use keyboard shortcut ALT + E to invoke expression builder. This utility shall enable to build and validate expressions as shown in the image below. Send the expression to clipboard and paste the same in the input field.
  • Example for conditions to evaluate: 
e.g. Variable.number + 10 >100  
e.g. Global.testNumber + 100 / Variable.colNum >=1000
e.g. Variable.data + "test" == “Apptest”
e.g. Global.hasData == 1
  • Save the process definition, create a process instance and execute.  Step should update the variable/variables with values. Render the process instance. Select Items - Variables - Latest menu option to view the variable values.