The bulk trigger and query steps in Pipelines initiate workflows based on a collection of records. When these steps run, they output an array of data. To process each record in the output of these steps, you can either:
- Use a loop
- Use Jinja expressions to access the first 100 records directly
Using Jinja is ideal for lightweight operations including:
- Sending a summary email of the first 100 records
- Performing conditional logic based on a subset of the data
- Creating compact dashboards or logs
This article provides examples of how to reference the first 100 records outputted using Jinja.
In this article
Limits
- Only the first 100 records are accessible with Jinja. To process more than 100 records, use a loop step instead.
Best practices
- Use Jinja for summary or preview operations
- Avoid using Jinja for complex transformations—use Loop steps for full-scale processing
- Always validate what fields are available to avoid unexpected errors
Examples
In these examples, a
is the index of the step you want to reference. You should change it based on your pipeline construction.
Access the first record’s name
{{ a[0].name }}
Loop over the first 100 records
{% for record in a %} - {{ record.name }} ({{ record.status }}) {% endfor %}
Use conditional logic based on a field in the first record
{% if a[0].priority == 'High' %} High priority item detected! {% endif %}
Dispatch a subform in FastField with dynamic data
The Dispatch a Subform step in the FastField channel dynamically populates sub-fields using array data from a bulk trigger or query step.
When you pass an array (for example, a.records
) into a subform field using Jinja, Pipelines automatically:
- Dispatches each item as a row in the subform
- Supports up to 100 items per subform dispatch
For example, you could reference the fields Name, Age, Address, and Job title by dragging them from the quick reference widget, or by selecting them from the drop-down picker:
When switching over to code view, you'll see Jinja references for each field:
This results in subform instances being pre-filled with data from each of the first 100 records. For example:
- The first subform instance is pre-filled with the data: name1, 12, street1, job1
- The second subform instance is pre-filled with the data: name2, 13, street2, job2
Learn more about the FastField channel.