updateVariable Step

Last published at: May 14th, 2024

Description:

Updates a variable/variables with 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
  • Let’s define a variable called “Status” using the define variables
  • Set the properties of the step to the following. The "hasExpression" is configured to NO when initializing the variables and configured to YES when using any valid expressions. A similar feature is available when configuring Globals. 
  • Save the process definition, create a process instance and execute.  Step should update the variable/variables with values
  • Configure the inputs to update multiple variables as shown below.

  • Click on the "Variable Value" field. Press Alt+E on keyboard to invoke the 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