Use results from earlier steps
Reuse a value from an earlier step, such as an invoice number or an amount, in a later step, much like a mail-merge field in a letter.
At the end of this page you will know how a later step reuses a value an earlier step found, such as putting the bill amount into an approval message.
Before you start
Open a workflow with an earlier step that produces the value you need. Keep a sample run available so you can compare the value with the source record.
It works like mail merge
In a mail-merge letter, you type a field such as "First name" where the name should go. When the letters print, each one gets the right name.
A workflow does the same. In a step's settings, you put a placeholder where a value from an earlier step should go. When the workflow runs, Loopfour swaps in the real value from that run.
What a placeholder looks like
A placeholder sits inside double curly brackets. It names the earlier step, then the value you want from it:
{{steps.read_bill.total}}
Read it from left to right:
- steps means "from an earlier step".
- read_bill is the earlier step's ID: the label Loopfour uses for that step inside the workflow. Workflows from chat or a template often have readable IDs like this one. A step you add by hand gets a generated ID, such as "block_" followed by numbers.
- total is the value that step produced.
So a Slack message set to Bill from {{steps.read_bill.vendor}} for {{steps.read_bill.total}} needs approval might post "Bill from Acme Supplies for 12,400.00 needs approval".
Add a placeholder
Open the later step
Choose the step that should use the value and open its Configure tab.
Find what the earlier step produces
Choose the earlier step and open its Output tab. It lists the values that step produces, such as an invoice number or a total.
Insert the placeholder
Back in the later step, put your cursor in the setting and press the Insert variable button (the curly-bracket icon) at the end of the box. It adds empty brackets. Type the step's ID and the value between them.
Or ask chat
Chat knows each step's ID, so this is the easier way. Ask, for example, "put the bill amount from the read step into the approval message".
Other values you can use
Besides earlier steps, a placeholder can reach:
- What started the run, such as the email that arrived or the event from your CRM.
- The input given to the run when someone pressed Run or another program started it.
- The current item inside a loop, such as the invoice being worked on. See Repeat for each item or run steps side by side.
- Secrets, such as a password your developer stored as a secret. The value is filled in only where it is used, and is not shown in the run record.
Good to know
- The earlier step must run before the step that uses its value. A placeholder pointing at a later step, or at a step that was skipped on this path, comes out empty.
- A placeholder inside a sentence always produces text, even when the value is a number.
- Fixed values that never change, such as your company's account number in a system, are typed straight into the setting. They do not need a placeholder.
Check it worked
Run the workflow, then open the run under Runs. Choose the step and open its Input tab to see what it received in that run. See Read a run step by step.
If something goes wrong
- The value came out empty. Check the spelling of the step ID and the value, and that the earlier step ran on this path. See Fix and retry a failed run.
Related
Start a workflow when another system changes
See which connected systems can start a workflow, such as a deal changing stage in your CRM or a payment arriving, and how to set one up.
Deploy, test and change a workflow
Deploy a workflow before its first run, test with safe data, review live changes carefully, and pause the workflow when you need to.
Loopfour