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 step can access the output data of any of its previous steps: both the trigger and actions.

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:

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:

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:

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:

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 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 are a good fit, use the Custom TypeScript Code action in the Code group, which lets you define a bespoke transformation in TypeScript or JavaScript.