Kinds of Data
Data moves between steps in a handful of shapes: plain values like text, numbers and yes/no, records (JSON), lists, and files. The shape decides what a later step can do with a value, and what to do when a step is handed the wrong one.
Plain values
Text, numbers and yes/no values pass between steps without any handling on your part.
The one thing worth knowing: Glow keeps a number a number. Some services reject "42" in quotes where they accept 42 without. Pick a value with the data selector and it arrives in the form the earlier step produced it. You rarely have to think about this.
Yes/no values (booleans) show as true or false. Conditions steps compare against these directly.
Records
A record (an object) is a bundle of labelled values that belong together โ a customerโs name, email, company and plan, travelling as one thing:
{
"name": "Ada Lovelace",
"email": "[email protected]",
"company": "Analytical Engines",
"plan": "pro"
}You reach a value inside it by naming the label after a dot. If that record came
from step 2, the email is {{ 2.email }}, and a record nested inside it needs
one more dot: {{ 2.customer.email }}.
If a field shows the whole thing in braces, you picked the record where the
field wanted one value. Dropping a whole customer into an email subject gives
Glow nothing single to print, so it writes the record out as text instead. Open
the data selector on that field again, click the arrow beside customer, and
pick email from inside it. You want the leaf, not the branch.
A reference that finds nothing fails the step and names the reference in the message, so a hand-typed path never reaches the next step as an empty value. Picking from the data selector avoids the typo in the first place.
Lists
A list (an array) is several items of the same kind โ forty rows from a spreadsheet, every email in a thread, the search results from an API:
[
{ "name": "Ada Lovelace", "email": "[email protected]" },
{ "name": "Alan Turing", "email": "[email protected]" },
{ "name": "Grace Hopper", "email": "[email protected]" }
]Positions count from zero and use dots, never square brackets, so the second
name is {{ 2.1.name }}.
An ordinary app action does not automatically repeat over a list. Give a โSend Emailโ step a list of forty addresses and it does not send forty emails. List steps can work on the collection as a whole; for an action, decide what should happen instead:
- Run the step once per item. Set the step to Run for each item and point it at the list. Inside,
{{ item }}is the one you are on. This is how you send forty emails. - Take one item out. If you only want the first result, reference it by position:
{{ 1.results.0.name }}. - Shrink the list first. The Filter step drops the items you do not want before the list reaches the step that cannot handle forty of them.
Which one you want depends on the job, and the wrong choice is usually visible immediately in the Executions tab.
Files
A file is not a value you can print. It is a thing Glow holds on to and hands over intact.
A step can produce a file, such as a PDF pulled off an email. Glow stores it for the run and shows it in the data selector as a file rather than as text. You move it by picking it, the same as any other value:
- In the step that produced the file, find the file in the data selector.
- In the step that should receive it (Google Drive โUpload Fileโ, for instance), click the file field and pick it.
Nothing else is needed. You never convert it, encode it, or write code to move it between services.
Whatโs Next?
- ๐ Step-Level Executions โ: inspect the real records, lists and files a step produced.
- Learn the expression syntax for reaching into nested fields in Variable Reference Syntax.