Today you work with records: values that hold other values, such as an invoice with a header, lines and totals. You will read their fields, convert text to numbers, and use them in formulas, decisions and loops.
1. Why logic matters
Logic turns a recorded list of steps into a process that adapts. With it, a bot can decide what to do from the data it reads, work through records with many levels, and calculate text, numbers and dates as it goes.
2. Records
A variable can hold a simple value (text, a number, true or false, a date) or a record. A record has named fields, and a field can hold a list or another record. Steps that read documents give you records. For example, Extract invoice data gives you an invoice like this:
{
"general": { "number": "INV-1001", "date": "2026-10-12" },
"from": "Acme Supplies",
"line items": [
{ "description": "Paper", "quantity": 2, "after tax": 115 },
{ "description": "Toner", "quantity": 1, "after tax": 230 }
],
"total": { "after tax": 345 }
}
Reading fields
Separate each level with ::. Lists are counted from 0.
{invoice::general::number} | INV-1001 |
{invoice::from} | Acme Supplies |
{invoice::line items::0::description} | Paper (the first line) |
{invoice::total::after tax} | 345 |
., :, -> and a single | also work as separators, so {invoice.from} is the same as {invoice::from}. Use :: to keep things consistent. Field names with spaces work as they are; for names with dots or other separators, see Keys that contain spaces or punctuation.
Fallbacks: ||
Two pipes mean "use this, or else that". It is not a separator.
{invoice::general::po number || "No PO"}: the PO number, or the text "No PO" if it is empty.{record::nickname || record::firstName}: the nickname, or else the first name.
More: Fallbacks.
Converting text to numbers: INT, FLOAT, STR
Values read from screens and documents are often text. Put INT, FLOAT or STR in front of the name to convert the value:
{FLOAT::price}: a decimal number, so "100.50" becomes 100.5.{INT::invoice::total::after tax}: a whole number. Decimals are cut off, not rounded: 345.90 becomes 345.{STR::count}: text.
If the value can't be converted, you get it back unchanged.
Records from documents
Steps that read documents give you records with a fixed set of fields:
- Invoices: Working with invoices
- Quotes: Working with quotes
- Purchase orders: Extract purchase order data
3. Exercise: read a record
- Create a process called Invoice Read Demo.
- Add an Extract invoice data step that reads a sample invoice PDF into the variable
invoice. - Add three Log message steps:
Invoice number: {invoice::general::number}Lines: {invoice::total line items}First line: {invoice::line items::0::description}
- Run it and read the log in the Runs tab.
Goal: the log shows the right values from the invoice.
In real processes, keep names, ID numbers and amounts out of logs.
4. Formulas with records
- Join fields:
=CONCAT({invoice::from}, " - ", {invoice::general::number}) - Choose by a field:
=IF({FLOAT::invoice::total::after tax} > 1000, "High", "Normal") - Add text values as numbers:
=SUM({FLOAT::price1}, {FLOAT::price2})
Every function: What calculation functions are supported.
Exercise: convert and add
- Add a Calculate expression step with two rows:
price1=100.50andprice2=49.50. - Add a third row:
total==SUM({FLOAT::price1}, {FLOAT::price2}). Rows run in order, so it can use the first two. - Log
Total = {total}.
Goal: the log shows 150 (or 150.0).
5. Decisions on records
Send invoices over 1000 for approval:
- Add a Decision with the condition
{FLOAT::invoice::total::after tax}>1000. - Connect TRUE to the approval steps and FALSE to the normal steps.
Connection colours on the map: DEFAULT / TRUE in your theme's main colour, FALSE amber, ALWAYS green, EXCEPTION red.
For more than two outcomes, for example a path per supplier, use a Switch on {invoice::from}.
6. Loops over records
To work through each line of an invoice, add a For each record in list loop:
- Variable:
invoice::line items(the list to go through) - Loop variable:
line - Inside the loop, read
{line::description},{line::after tax}and so on.
Exercise: sort the lines
- After the Extract invoice data step, add the loop above.
- Inside it, add a Decision:
{FLOAT::line::after tax}>200. - TRUE → Log
Large line: {line::description}. FALSE → LogSmall line: {line::description}. Connect both back to the loop. - Connect the loop's FALSE path to a final Log:
Done.
Goal: one log line per invoice line, then "Done".
7. Quick reference
{a::b::c} | Field c inside b inside a (also . : -> |) |
{list::0::field} | A field of the first item in a list |
{a || b} | a, or b if a is empty |
{a || "text"} | a, or the text if a is empty |
{INT::a}, {FLOAT::a}, {STR::a} | Convert to a whole number, a decimal, or text |
{=FORMULA(…)} | A formula inside text |
8. Good habits
- Keep field names the same across processes.
- Prefer one record to many loose variables for complex data. It is easier to pass on and to extend.
- Convert before you calculate. Use
FLOATorINTon values that may be text. - Give fallbacks with
||for fields that may be missing. - Split long formulas into several variables so they are easy to check.
End of Day 7 summary
You should now be able to:
✅ Read fields and list items from records
✅ Give fallbacks with ||
✅ Convert text to numbers before you calculate
✅ Use records in formulas, decisions and loops
✅ Find the help pages for invoices, quotes and purchase orders
Where to go next
That is the end of the series. To go further: