> ## Documentation Index
> Fetch the complete documentation index at: https://openops-ecb4f397-mintlify-helm-chart-documentation-30057.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Passing Data

> How to pass data between workflow steps

Any OpenOps workflow consists of multiple steps. The first step is a **trigger**, followed by any number of **action** steps.

## The general principle of data flow

Any [action](/workflow-management/actions/) step can access the output data of any of its previous steps: both the trigger and actions.

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/parameters-example.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=4a8e6a61cd11a79c21588ac930749ef8" alt="A sequence of steps from a workflow" width="453" height="741" data-path="images/parameters-example.png" />

For example, in the section of a workflow shown above:

* **Step 5** has access to data produced by steps 4, 3, and 2. The only reason it doesn't have access to data from step 1 is that the Schedule trigger step doesn't produce any data.
* **Step 4** has access to data produced by steps 3 and 2.
* **Step 3** has access to data produced by step 2.

There are certain nuances when it comes to accessing data from loops and conditional statements that were executed before:

1. If there was a conditional statement, such as **Condition** or **Split**, before your current action, then your current action will not have access to the outputs of any actions inside the branches of the conditional statement. If you need the output of actions in these branches to be available after the conditional statement completes, make sure to save it elsewhere, such as in OpenOps’ internal storage using the **Put** action in the **Storage** group. You can then retrieve it from storage using the **Get** action in the same group.
2. This is also true for loops: the output of actions that occur inside a loop is not available outside the loop. If you need any data from the loop after it completes, make sure to save the data to storage while still inside the loop.

## Selecting data from prior steps

When you create a new action step, chances are that its properties pane contains one or more data fields that accept data from previous steps. When you click in a data field, it opens the **Data Selector** pane, which helps you select a piece of data produced by previous steps as the input for the current step.

Continuing with the example above, when you click in the **Items** field in the properties pane of the **Loop on items** action step, the **Data Selector** suggests all data generated prior:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/parameters-data-selector.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=6c971e66bdd919de03687ab35c74c63a" alt="Data Selector" width="1027" height="363" data-path="images/parameters-data-selector.png" />

If an item in this panel has a caret (**⌄**) to the right, you can click on it to expand its children. When you've found the piece of data you need, click **Insert** next to it to use it in the current data field.

Take time to expand the items before inserting them to understand the type of data they contain and whether they're the right fit for your needs. For example, the output data from a previous step may be an object with a list (array) inside. If you want to iterate over the list using the **Loop on items** action, you need to select the nested list instead of the entire object:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/parameters-nested-array.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=380b7b39b602450df70978b67201c277" alt="Selecting a nested list as the input parameter" width="1030" height="598" data-path="images/parameters-nested-array.png" />

If the type of data you want to use as input is a list, before selecting it with the **Data Selector**, make sure to switch on **Dynamic value** mode by clicking the toggle above the data field:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/parameters-dynamic-value.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=9294252cf04857b06cc27e3e3ef49c62" alt="Dynamic value toggle" width="486" height="237" data-path="images/parameters-dynamic-value.png" />

Also note that although the **Data Selector** appears in every input field, you don't always have to use it. Sometimes, you can simply enter a value manually. For example, if you're using the **Group By** action to regroup a list, just type in the property key that you want to group by in the **Property Key** field:

<img src="https://mintcdn.com/openops-ecb4f397-mintlify-helm-chart-documentation-30057/hfZdRnuoiSN-v4sh/images/parameters-group-by.png?fit=max&auto=format&n=hfZdRnuoiSN-v4sh&q=85&s=8427d4db2d4206f2b9263c97162f3c1e" alt="Grouping a list" width="490" height="422" data-path="images/parameters-group-by.png" />

## Transforming outputs

Sometimes, the output of a previous step may not be immediately suitable for use in your next steps. In this case, you can use several [actions](/workflow-management/actions/) or combinations of actions to transform the output into a different format:

* Use actions from the **Text Operations** group to concatenate, split, or otherwise transform text values.
* Use actions from the **Math Operations** group to perform arithmetic operations, calculate averages, or return minimum and maximum values.
* Use actions from the **Date Operations** group to format dates, extract individual date units (year, month, day, hour, etc.), or calculate date differences.

If the output you want to transform is a list, first create a loop using the **Loop on Items** action, then use any of the actions listed above to transform individual list entries inside the loop.

There's also a group of actions called **List Operations** that you can apply to a list without creating a loop:

* **Group By** creates several nested lists, each containing one distinct value of a property that you specify.
* **Map List Items** does the same as **Group By**, but makes each nested list the value of a separate property.
* **Extract From List** keeps only one out of many properties in each list item.

Finally, if none of the transformation actions above meet your needs, use the **Custom TypeScript Code** action in the **Code** group to define a bespoke transformation in TypeScript or JavaScript. If you're not an experienced developer, [AI assistance](/ai-assistance/overview/) can help you generate the code.
