How to use data from one workflow step in the next
In a TeleportHQ workflow, each step can use data from the steps before it. This data is called the Context. Click a step, then drag a value from the Context panel at the top right of the workflow canvas onto a field, or click the Select from context button next to a field and pick the value. For example, you can put the email address someone typed into your form into the To field of a Send Email step.
Before you start
- You need a workflow with a trigger and at least one step after it. See How to create a workflow.
- A step can only use data from the trigger and the steps above it. Data from later steps isn't available.
Steps
This example sends a confirmation email to the person who filled in a bakery's Order cake form.
1. Find the data
- Open the workflow in the Workflows panel.
- On the canvas, click the step that needs the data, for example Send Email (SendGrid). Keep the Node Properties tab open in the right panel: the Context panel only shows on that tab.
- At the top right of the canvas, the Context panel shows the number of items available to this step. Click its header to fold or unfold it.
- Find the trigger's item, for example the Form is Submitted data, with its fields such as
emailandname. With more than three items, use Search context... to find one.
Click the info icon in the panel header (tooltip How to use context) for a short guide, Using Workflow Context.
2. Put the data into a field
Use either method:
- Drag and drop: drag the
emailitem from the Context panel onto the To field in the right panel. - Pick from a list: next to the To field, click the connect button (tooltip Select from context). In Select Context Value, click
email.
The field now shows a badge with the value's name instead of text.
3. Mix data with your own text
Some fields let you combine typed text with context values:
- In an email's Raw content body, click Insert Variable in the editor's toolbar to add a value at the cursor, for example
Hifollowed by thenamevalue. - In an SMS Message, click Add value to concatenate to add another part, then type text in one part and pick a context value in the next. The parts are joined in order.
- In the conditions of Select Data and Count Data, Insert Variable adds a value from a previous step.
Check that it worked
- Click the badge in the field (tooltip Click to locate in context panel). The matching item is highlighted in the Context panel.
- Test the step. The test window lists the values it needs under Inputs from previous nodes, so you can type sample values. See How to test a workflow step.
Troubleshooting
The Context panel says "This is the first step. Context from previous steps will appear here as you add more nodes." You selected the trigger or the first step. Select a step further down.
The Context panel says "No context available from previous steps." The steps above don't produce data you can use. Check that the step is connected below the step whose data you need.
The Context panel isn't on the canvas It only shows while a step is selected and the Node Properties tab is open. Click a step, then click Node Properties.
The Select from context button is greyed out ("No context available") There is no earlier data for this step. Move the step lower in the workflow or add the step that produces the data first.
I can't drop a whole object onto a field Unfold the item and drag one of its properties, for example email rather than the whole form data.
"Some pasted steps read data from steps that are not in this workflow: … Update their settings." You pasted steps whose fields used data from steps you didn't copy. Open each named step and pick its values again.
A step shows "Missing" or a Missing State References warning A state the step used was deleted or renamed. See Why does my workflow show missing configuration or security warnings?.
Good to know
- Context values have types: Text (single values), Object (contains properties) and Array (lists of items).
- To remove a value from a field, click the × on its badge (tooltip Remove context binding).
- To use a page state inside a workflow, add a Get Local State or Get Global State step first, then use its result.
- Custom nodes receive all context from the workflow that runs them. See How to reuse a group of steps (custom nodes).