When configuring the trigger, suppose you specify a list/array of objects in the payload (or sometimes headers). These values are presented in a special syntax when creating a condition or configuring a notification event action and are called an Index or Indices.
For instance, let's say our payload looks like this.
name will appear as
input.body.batch.[#index#].name respectively when configuring the Condition or the Notification Event.
#index# syntax is called an "Index". When dealing with Indices in an Automation, you should provide a substitute value (either a number or 'all') which the automation uses when invoked.
When a key containing
#index# is selected as a variable in a condition, you will need specify a numeric index value.
For example, let's say that you know that the first email in the list is always going to be
[email protected] when you invoke the automation.
We specify the condition
input.body.batch to build this condition.[#index#].email equals [email protected] and type in the
index value as
Indices can only be numeric and always start with
When the automation evaluates this condition, it replaces the
0to check if the first email in the list is
When a key containing
#index# is selected in either the To or Data sections of an notification event, we see 2 options:
- Send to all
- Send by index
For instance, if we select
input.body.batch.[#index#].email when configuring the email channel and select "Send to all" as the index, the automation will send the email to all the emails specified in the list. However, if we select "Send by index" and set a numeric value, say
1, the email will be sent only to the second email in the list -
[email protected] in our example.
Each sections' values for
query etc depend on the location where they appear when configuring the trigger. The below table has the complete list.
|Location in trigger||Section value (to be selected)|
Good to Remember
- If the payload contains multiple lists/arrays, the same list/array should be chosen if configuring multiple channels or if configuring the distinct id and a channel. Similarly, if the data or additional data also contains a list type, it should be the same list/array as used in the channel/distinct Id configuration.
- The data or additional data cannot have a list/array type if the channel and/or distinct Id do not.
- When using indexes across the distinct Id/channels and data, the index value should either be 'Send to all' or 'Send by index'. It can never be a combination of the two.
Updated about 1 month ago