Looping is a common method to iterate through a list in Tines.
Enabling loop
Drag an event transform action onto your storyboard. On the configuration panel on the right, click on "Loop".
Note: The local value will reset at the beginning of each loop iteration.
How to use use loop
You can follow along in the following video:
Or, look more closely at the examples by going to the story library and importing the explore loop example story into your tenant.
Use the explode event transform action
The first and easiest way to loop through a set of arrays in Tines is to use the explode event transform action.
Explode allows you to loop through each array that is specified in the path and output multiple events related to each specific array that exists.
This is useful when you want to perform enrichment or further actions on each specific array in a new unique event.
Use the event transform action in message mode
The second way to loop through events is with the event transform action in message mode with the loop option enabled.
The main difference with this approach is that a single event is emitted instead of multiple. This allows you to create a new single event using array data that has been looped through.
Use tags
The third way to perform looping is to use tags.
This method comes in handy if you have two different groups of arrays and you want to loop through them.
Note: If you are familiar with Python, this will look similar to how a for loop is constructed.
Example: How to loop through data with event transform action
This video outlines how to use event transform to loop through an array of data in Tines.
👉 For examples of using loop see here
