Arrays are a commonly used data structure in Orchestrator workflows and can be sourced from triggers or actions.
Arrays are a powerful tool in Orchestrator workflows, and understanding how to extract values from arrays is valuable. Whether working with triggers, actions, or variables, being able to reference specific values in arrays helps build more efficient and effective workflows.
Working with Arrays in Triggers
When using triggers, configure them by filtering on specific array values.
Assuming that the trigger has the following data:
{ "locales": [ {"name": "de"}, {"name": "en"}, {"name": "fr"} ] }
If a trigger payload contains an array of locale names, create a trigger filter to only trigger the workflow when the first locale name is de. To achieve this, use the comparator and enter {{ $.data.locales.0.name }}
for the value. The index in the array is separated by dots.
Working with Arrays in Actions
If an action returns an array and requires the dynamic use a specific value from that array in the next action, reference the value using the appropriate index.
As an example, an action returns the same data as in the trigger example. To extract the first locale name from the array, enter {{ $.locales[0].name }}
. The index in the array is separated by square brackets. There is also no data in the path.