Assign Values to Scalar Variables in an Assign Action

You can assign values to scalar variables in integrations with an assign action.

Note:

  • Variables created inside a scope action or a looping action (for example, a for-each or while action) are not directly accessible outside the scope/looping action. To access the variables (local) outside a scope/looping action, create a global variable using an assign action above the scope/looping action. Assign the local variable to this global variable and then use it outside the scope/loop action.

  • Values cannot be assigned to other variable types, such as complex types.

  1. Add an assign action to an integration in either of the following ways:
    • On the side of the canvas, click Actions Integration actions icon and drag the Assign action to the appropriate location.
    • Click Add icon at the location where you want to add the assign action, then select Assign.

    The Configure Assign panel opens.

  2. Click Edit Edit icon under Configure Assign to enter a name and optional description for the assign action.

  3. Click the + sign, then select a data type:
    • String: Create a string data type.
    • Fault: Catch and aggregate faults in parallel processing actions in schedule integrations. This operation is only supported in schedule integrations.
  4. If you select String:
    1. Enter a string variable name or select an existing variable from the list.


      The Sources elements are shown. The Input Sources tab is selected. The Functions tab is next to it. On the right, the Configure Assignment section is shown. A name and description field are shown below. Below this, the name in the Variable field is being selected from a list. To the right of this field are clear and switch to developer mode icons.

      The Operations field defaults to an equal sign (=) and cannot be changed.

    2. Enter a value between the single quotes.


      The Variable, Operation, and Value fields are shown.

    3. Add more string variables, when needed.


      The Configure Assignment panel shows the name and description fields at the top. Below this, five string variables are shown as defined.

  5. If you select Fault:
    1. Enter a fault variable name or select an existing fault from the list.
    2. Select an operation from the Operation list.
      • Append: Adds a new fault to the end of the fault list.
      • Clear: Removes all entries in the fault list.
    3. If you selected Append, click Edit Edit icon to select a fault from the mapper in the Value column. This option is not available with the Clear operation.


      The source errorCode element is mapped to the target errorCode element.

  6. Add more fault variables, as needed.
  7. Click Save.

Variable assignments can be of great complexity. You can use assignments in switch actions and maps. For example, the upper branch of a switch action is taken (if $FetchContactAssign = "failed"), which processes a contactCreateProcessing scope. Otherwise, a contactUpdateSkip scope is processed.

You can also configure the primary tracking variable and both custom field tracking variables (update and access values). You can map tracking variables to output variables or create complex expressions for an assign or switch activity.

  • All tracking variables are of type string (all that assignments support).

  • All three tracking variable entries are present even if you choose not to model them. The name and XPath can be empty for tracking.

  • Editing or deleting the tracking variables only updates the name and XPath nodes in that particular tracking variable element.

  • The tracking variables have static names. Therefore, it is possible to set a tracking variable somewhere in the flow, but not initialize it with a value and a name in the Tracking dialog.

  • The primary tracking variable cannot be assigned any value in between the flow.

  • You cannot create a new variable with the same names as any of the statically name tracking variables.

Related Documentation
The following sections provide examples of using an assign action in an integration: