Scopes in Data Mappings

The Available data pane in the mapper displays the output data from preceding activities, triggers, and flow inputs. This area groups the output elements based on a scope. A scope represents a boundary in the Available data within which an input element can be mapped. For example, when mapping an input element to an element from the output of a trigger, the scope of the input element is represented in Available data as $trigger. The following scopes are currently supported by the mapper.

Scope Name Used to... Available in...
$trigger Map flow input to trigger output. Trigger (Map to Flow Inputs tab) to map flow inputs to trigger outputs.
$flow Map flow output to trigger reply.
  • Trigger (Map to Flow Outputs tab) to map flow output to trigger reply.
  • Activities (Input tab) to map activity input to flow input.
  • Return activity (Map Output tab) to map flow output to flow input.
$activity.[activity-name] Map input elements of the activity to elements from the output of previous activities.

$activity represents the scope of an activity. [activity-name] indicates the activity whose scope you are defining. Each preceding activity has its own scope in the mapper.

$iteration Keep track of the current iteration and is available only when iterator is enabled for an activity on the Loop tab. Input tab of an activity that has Loop enabled. This tab is displayed only when the Loop for the activity is enabled. The following elements are displayed under $iteration:
  • key - This element represents the iteration index. Thus, it is always of type number. For example, if the Loop expression is set to an array, the key element represents the array index of the current iteration.
  • value - The value can be of any type depending on what is being iterated. For example, if you are iterating through an array of strings, the value is of type string.
$property [property-name] Map to app properties that are defined in the app.

For any app that has app properties defined, this scope is available for mapping from any activity that allows mapping. Even the app properties from connection are available for mapping under this scope.

All the mapped configurations can be pre-checked using a flow tester or by creating a pre-check flow.

$loop Map elements within an array. $loop is prefixed to the element name when mapping an element that is within an array. The scope of $loop is the current array that you are iterating through.
$flowctx Map the flow context details to the current flow.

Input tab of every activity. The scope provides flow context details that can be mapped to any activity that allows mapping. Using this scope unique parameters like FlowId, Flowname, ParentFlowId, ParentFlowName, SpanId, TraceId can be accessed in the flow and subflow.

Here:

  • The ParentFlowId and ParentFlowName is the ID and name of the flow that is invoking the current flow.

  • The TraceId is the unique ID of a single request, job or a action initiated by the user.

  • The SpanId is the unique ID of the activity

Note: This scope is only available for the flow configuration and not for the trigger configuration.