Reference data in the workflow

There are several locations where data is storage, you can use those locations to reference data.

Who can use this?

Plans:

  • Bridge by Smartsheet

Reference data from the runtime

The runtime is where trigger data from an integration is stored. The reference for the runtime data is {{runtime}}.

You can reference data pieces stored within the runtime. When referencing these items, you should specify the name of the individual item.

For example, if a sheet in Smartsheet triggers a workflow and you need to reference the ID of the row involved, the reference could look like this: {{runtime.event.rowId}}.

The exact structure and naming convention differ depending on the trigger and event type.

To make sure you are using the correct reference:

  1. In the Run Log, hover over a trigger object. 
  2. Select  Brandfolder Image Data Shuttle kebab menu .
  3. In the list that appears, select Copy Data Reference.
Brandfolder Image
Reference data

Reference data from a state

You may want to reference a state when data is passed from a parent workflow. The reference format is {{states.state name.value}}.

If you want to reference data from a module below a state, the state still plays a part. In this case, the reference structure would be {{states.state name.integration or utility name.module name}}.

If a module can output multiple data values, add the path for this specific data in your data reference (similar to how you reference individual pieces of runtime data).

For example, the Smartsheet: Get Row module defaults to returning the data in the image below.

Brandfolder Image
Reference data

To reference the value entered in the Address cell on the row, the reference would be:
{{states.GetRow.smartsheet.get_row.row.cells.Address.value}}.

Reference data from a parent workflow

You can reference data from a parent workflow within a child one. To do that, follow these steps:

  1. Copy the data reference you want to use from the parent workflow
  2. Add a Run Child Workflow module within the parent workflow, and name it.

In the parent workflow, in the child module:

  1. Select Child entity values. 
  2. Add a key, this is a name you will use to reference the data in the child workflow.
  3. Add the corresponding value, which is data reference you copied in step 1. It could look like something like {{states.startstate.stringtools.compose_text}}

In the child workflow:

  1. Select the module where you want to reference the parent workflow data.
  2. In the field where you want to reference the parent workflow data, enter {{runtime.entities.text}}, where “text” is the key added in step 4. 

If you want to reference {{runtime.entities.text}} like {{states.text.value}} within the child workflow, you need to create a state with the name “text” in the child workflow

Reference data from a child workflow

You can reference data from a child workflow within the parent workflow. To do that, your data reference could look like this:

  • states.{{state that runs the child}}.child.{{state in child}}.value.; or
  • states.{{state that runs the child}}.child.{{state in child}}.integration or utility.module.

Empty data references

When the next step of your workflow depends on a specific value, which may or may not exist, you can use vertical bars (||) to handle two scenarios.

For example, you want to use the value in a Smartsheet cell to determine which path of a junction the workflow goes down. But you can't be sure the cell will always contain a value.

If the cell is empty, the workflow stops when it reaches the junction. Add vertical bars (||) at the end of your data reference to avoid this. If that value has data, the workflow will use the reference to the left of the bars. If data doesn’t exist in that cell, the workflow will use what is on the right of the bars.

Take a look at the two possible scenarios in this reference:
{{states.GetRow.smartsheet.get_row.row.cells.Address.value||116 George Street, Edinburgh, UK}}

  1. The workflow first tries to use the address from the row it got earlier: GetRow.smartsheet.get_row.row.cells.Address.value.
  2. However, if that cell is blank, it will use the address specified after the vertical bars: 116 George Street, Edinburgh, UK.

Tips for using vertical bars

You can use:

  • another data reference after the vertical bars rather than a typed value, or
  • multiple vertical bars to handle several different possible scenarios.

Mix text and data references

In most modules, you can combine written text and data references. You can type out the parts of the email that should always be the same and use data references for the parts that might not always be the same, such as the name of a recipient or a date.

If you built the weather workflow in the Start a blank workflow for US Weather Service article, you might have noticed that the URL used in the API call to the US Weather Service contained two data references.