Lists (Arrays)

How to Create a List

Relay.app has various tools to perform operations on lists of data in your workflow. There are three common situations in which you might encounter lists.

1. A Step Output representing a list of app objects

For example, a List of Jira tickets obtained through a Find Step by configuring it to return All matching issues in a list.

The Step Output pill will contain a badge with three horizontal lines on top of the app icon, to indicate it's a list of Issues, not just a single Issue

Relay.app workflow step showing Jira Find Issues action configured to return all matching issues in a list format
Example of a Step Output representing a list of objects (Jira issues)

2. A Step Output containing a (nested) field that's a list of items

For example, a Step Output representing an Email object from Gmail contains a number of Lists:

  • Lists of recipients (one for the To-line and CC-lines)

  • A List of File Attachments

  • A List of Labels

Note: while [the structure of] every Email object contains these Lists, this doesn't mean that they contain data for every email. e.g. when an Email doesn't have any attachments, the List of Attachments is simply empty.

Gmail email step output showing nested lists including attachments, recipients, and labels fields
Example of a Step Output containing lists of items (an Email containing Attachments, recipients and Labels)

3. A Step Output containing a (nested) list of app objects

For example, a Deal object from HubSpot contains Lists of associated Compenies, Contacts, Tasks, and many others.

HubSpot Deal step output displaying associated objects including lists of companies, contacts, and tasks
Example of a Step Output containing lists of other app objects items (a HubSpot Deal containing associated Companies)

How to Work with a List

Iterators: perform actions for each item in a List

Once you have a list of items, the most common thing you'll want to do is to perform an action for each item in the list (e.g. upload each attachment to Google Drive). Iterators let you perform one or multiple actions for each item in a list. Read more about Looping (Iterators)here.

Use your List as input for an AI step

Another very common use case is to analyze or synthesize a list of data using AI. For example, to create a digest of a list of newsletters or get combined insights from customer calls. In this case, you'll create a "prompt any model" AI step and use the list as input in data for previous steps.

This technique is demonstrated at 1:35 of this video:

An example workflow that uses an AI analysis of a list

Unroll or Combine list data as Text [Advanced]

If you want to create a text representation of a list in e.g. a a bulleted list in an Email body, and you don't want to simply use an AI step to do the formatting for you, you can used the more advanced 'Unroll' feature to create custom formatted text from a list.

The 'Unroll' feature lets you do this in multiline text inputs, and the 'Combine' feature for single-line text inputs.

Multi-line text input showing unroll data option with template structure for formatting list items
Multi-line Text inputs let you "unroll" List data using custom template structures
Single-line text input showing combine data option to merge list items into comma-separated format
Single-line Text inputs let you combine List data into a comma-separated string

Unroll List data using a custom template structure

Unrolling a List lets you specify a templated structure that will be repeated for each item in the list. For example, you can use this to create a bulleted list with key information about all currently open Jira issues.

List unroll template showing bullet point structure with Jira issue key, summary, and assignee for each item in the list
Example of a Lis 'Unroll', creating a bullet structure that lists out key details for all currently open Jira issues

For a detailed demonstration on how to unroll a list, you can check out this video:

Detailed demo of unrolling a list

Combine List data into a comma-separated list

The 'Combine' feature is similar to the 'Unroll' feature, except for that it's hard-coded to concatenate all values in the list separated by commas. You can use this in signle-line text inputs.

Text input field showing combine data option to create comma-separated list from multiple values
Preview showing the result of combining list data into a comma-separated string format

Using the Size of a List

All Lists have a Size property. You may use this in a workflow to determine the number of items in the List, and define behavior accordingly. For example, by creating Paths for cases where the List contains 0, 1 or multiple items.

Step output data picker showing Size property of a list that indicates the number of items in the list
The 'Size' property of a List may be used to determine how many items are in a list during a Run

Explicitly selecting the first item from a List

While in the majority of cases you'll want to wrap an Iterator around a list, there may be cases when you want to explicitly pick the first item from a list to perform an action on. For example, your CRM might let you add multiple 'Associated Companies' to a Deal, even though you're only ever adding one at most. In that case, you can probably just use the 'first result'.

This is why Step Outputs for Lists will still show up in data pickers that only accept a single item. You'll see a 'First result' entry that lets you pick the very first result.

Dropbox upload step configuration showing first result option to select the first attachment from an email list
Uploading the first attachment in an email to Dropbox
Jira add comment step showing first result option to select the first issue from a list of issues
Adding a comment to the first Jira Issue from a list of Issues

Last updated

Was this helpful?