Day 3 - Variables, Loops, and Data Handling

Make your processes work with changing data: store values in variables, work them out with spreadsheet-style formulas, and repeat steps with loops.

Help Centre › Getting Started

Today you make your processes work with changing data: names, amounts, file paths and dates. You will use variables to hold values, formulas to work them out, and loops to repeat steps.

1. Why changing data matters

A recorded "Type text: John Smith" always types John Smith. Real work needs a different name each time. Using data instead of fixed values makes a process:

  • Reusable for many cases.
  • Easier to change and to grow.
  • Able to work things out and decide for itself.

2. Variables

A variable is a named value that the process holds while it runs, such as {CustomerName}. Wherever a step takes text, you can type {CustomerName} and the bot puts in the current value.

A variable can hold text, a number, true or false, a date, or a record with fields of its own, such as an invoice with a number, a date and lines. You reach a field with ::, for example {invoice::number}.

Where variables come from

  • Earlier steps. Many steps save their result in a variable you name, such as a value read from a screen or an Excel cell.
  • The Calculate expression step. Set a variable yourself: one row per variable, with its name and a value or formula.
  • Loops. Each time round, a loop puts the current item in the loop variable you name.
  • Built-in variables such as {dates::today} and {now::time}. See Built-in variables.
  • Assets: shared values your company keeps in the Library, such as a folder path.

Tip: use clear names such as CustomerName or InvoiceAmount. Names are case-sensitive.

All the details, including fallbacks like {nickname || firstName}: Working with variables in RPAs.

3. Formulas

Automize has spreadsheet-style formulas. There are two ways to use one:

  • Start a whole field with =: =CONCAT("Hello ", {Name})
  • Put a formula inside other text with {=…}: Total due: {=ROUND({Amount} * 1.15, 2)}
FormulaWhat it does
=1 + ({number} * 4)A sum using a variable
=CONCAT("Hello ", {Name})Joins text
=IF({Amount} > 1000, "High", "Low")Picks one of two values
=SUM({Value1}, {Value2})Adds numbers
=LEFT({Text}, 4)First 4 characters
=FIND("-", {FileName})Position of a character
=LEN({Text})Length of the text
=NOW()Current date and time

Full list: What calculation functions are supported. If a formula goes wrong you see a marker such as #VALUE!: see Formula errors.

Exercise: variables and a formula

  1. Record a new process named Greeting Formula that opens Notepad, then stop recording and open it on the website.
  2. From the Add step tab, add a Calculate expression step with two rows: UserName = Alex and Items = 3.
  3. Add a Type text step after Notepad opens. In Write, enter: =CONCAT("Hello ", {UserName}, "! You have ", {Items}, " items pending.")
  4. Connect the steps, save and play the process.

Success: Notepad opens and the greeting is typed using your variables.

4. Loops

A loop repeats steps once for each item: each row in a sheet, each file in a folder, each unread email, and so on.

  1. Open the Add step tab, type "loop" and drag the loop you need onto the map, for example For each file in folder.
  2. Fill in what it loops over, and give the Loop variable a name, for example file. Inside the loop, read the current item as {file::name}, {file::path} and so on.
  3. Connect the loop's DEFAULT path to the steps to repeat, and the last of those back to the loop. Connect its FALSE path to what happens once every item is done.

Each kind of loop, filters and the connection rules: Working with loops in RPAs. What each loop gives you: Loop variables.

Exercise: loop through a list

  1. Create a process called Loop Names that opens Notepad.
  2. Add a For each item in list loop. Set List to Alex, Ben, Carla and Loop variable to name.
  3. Inside the loop, add a Type text step with =CONCAT("Hello ", {name}), then a Press keyboard key step for Enter. Connect the Enter step back to the loop.
  4. Play the process.

Success: Notepad shows "Hello Alex", "Hello Ben" and "Hello Carla" on separate lines.

5. Working with real data

Excel

  1. Add a For each row in Excel sheet loop with the file path, sheet and first data cell. Tick that it has a header row.
  2. Inside the loop, each column is available by its heading, such as {Name}.
  3. Use formulas to combine or work out values, and write results back with the Excel steps.

PDFs and emails

  • Read text with a step such as Extract data (PDF), Extract text from image, or an Outlook step, and save it in a variable such as {Text}.
  • Find values in it with formulas such as =FIND("Invoice:", {Text}), or read an invoice straight into fields: see Working with invoices.

6. Challenges

  1. Dynamic calculator: set A and B with a Calculate expression step, then type =SUM({A}, {B}) into Notepad.
  2. Excel greetings: read a list of names from Excel and type or email a greeting to each.
  3. Decide with a formula: if {InvoiceTotal} is over 1000, type "High value invoice", otherwise "Standard invoice". Try it once with IF() in a Type text step and once with a Decision.

7. Good habits

  • One job per variable. Don't reuse a variable for unrelated data.
  • Give a default. Use a fallback such as {discount || 0} where a value may be missing.
  • Keep loops lean. Every step inside runs once per item. Filter the data before you loop over it.
  • Keep formulas short. Break a long formula into several variables, and test it with known values.
  • No hard-coded paths. Use variables, built-in folders or Assets for file locations.
  • Reuse. Turn logic you need in many places into a sub-process.

End of Day 3 summary

You should now be able to:

✅ Create and use variables
✅ Work out values with formulas
✅ Repeat steps with a loop
✅ Read data from Excel, PDFs and emails

Next step (Day 4)

Learn how to test, debug and read logs, so you can find and fix problems quickly.
Next

Get started

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or have your first automation working in 7 days.