Day 3 - Variables, Loops, and Data Handling

Learn how to make your processes dynamic by using variables, loops, and Automize's Excel-style formula engine to handle data intelligently.

Help CentreGetting Started

Day 3 - Variables, Loops, and Data Handling

The goal is to learn how to make your processes dynamic by using variables, loops, and Automize's Excel-style formula engine to handle data intelligently.


1. Why Dynamic Data Matters

Most real-world automations require handling changing data - names, amounts, file paths, or dates. Instead of recording static values, you'll now learn how to make your processes data-driven.

Dynamic data makes your bots:

  • Reusable across different scenarios.

  • Easier to maintain and scale.

  • Smarter - able to make decisions or perform calculations automatically.


2. Understanding Variables

A variable stores a piece of information during your process, such as a number, text, or Boolean value. Variables make your automation flexible, allowing you to re-use and change values easily.


Example

If you record "Type text: John Smith", that value is fixed. But if you use a variable {CustomerName}, your process can type any name passed into it.


Types of Variables

TypeDescriptionExample
TextWords or characters"Invoice 001"
NumberNumeric values123 or 45.67
BooleanTrue or FalseTRUE
Date / TimeTime-based data2025-11-12 08:30
ObjectA complex object that contains other variables and / or objects{"name": "Image.png", "dimensions": {"width": 100, "height": 200}, "image": TRUE}

Creating a Variable

You can create a variable in three ways:

  1. During recording - Automize automatically creates variables for dynamic fields.

  2. In activity properties - define a variable directly in an activity input field using {variableName}.

Tip: Use meaningful, readable names - CustomerName, InvoiceAmount, LoopIndex.


Using Variables

You can insert variables into text fields or activity parameters:

=CONCAT("Processing order for ", {CustomerName})

Or simply refer to them directly:

{FilePath}


3. The Excel-Like Formula Engine

Automize includes a built-in Calculator Engine, allowing you to transform data with Excel-style formulas - no coding required.


Common Formula Examples

FormulaDescription
=1 + (3 * 4)A simple calculation
=1 + ({number} * 4)A simple calculation using a variable called "number"
=CONCAT("Hello ", {Name})Joins text
=IF({Amount}>1000, "High", "Low")Conditional logic
=SUM({Value1},{Value2})Adds two numbers
=LEFT({Text}, 4)Extracts first 4 characters
=FIND("-", {FileName})Finds a position of a character
=LEN({Text})Gets text length
=NOW()Returns current date/time

Note: Formulas can be used in most text fields or assignments throughout Automize. For a full list of function that you can use in your formulas, refer to What calculation functions are supported.


Hands-On Exercise: Using Variables and Formulas

Objective: Create a process that greets a user with their name and calculates a simple value.

Steps:

  1. Open the Automize Bot → Record a new process named "Greeting Formula".

  2. Open Notepad.

  3. Stop recording and open the process in the Web Portal.

  4. Edit the process and add a new Keyboard → Write activity.

  5. Create two variables:

    • {UserName} = "Alex"

    • {Items} = 3

  6. In the Text to Type field, enter:

    =CONCAT("Hello ", {UserName}, "! You have ", {Items}, " items pending.")

  7. Save and play the process.

Success Criteria: Notepad opens and the text is automatically typed using your variables.


4. Loops and Iterations

Loops let you repeat one or more activities multiple times - useful for repetitive tasks like reading Excel rows or files in a folder.


When to Use Loops

  • Reading through data tables.

  • Processing multiple files in a folder.

  • Navigating multi-page web results.

  • Reading all unread emails in your inbox.


Creating a Loop

  1. Click on the top right button:{{buttons:processes/edit}}

  2. Select the + Activity option

  3. Select RPA at the top, and then Loop from the Actions, and select on of the Loop options.

  4. The following popup will appear: {{popups:rpas/add:action=loop-files}}
  5. Complete the form (especially the conditions as and when they apply) and press Add.

  6. Connect the loop to other activities as required.

  7. Remember loops require a DEFAULT and a FALSE condition. The DEFAULT connection will be followed as long as the conditions are met, and the FALSE path will be followed when the conditions are not met and the loops are stopped.

Tip: Each loop iteration automatically updates the loop variable as you have define it in the "Loop variable". For more about conditions, please read Working with conditions.


Hands-On Exercise: Looping Through a List

Objective: Create a process that types several names, one per line.

Steps:

  1. Create a new process called "Loop Names".

  2. Add a variable {Names} = ["Alex","Ben","Carla"].

  3. Add a Loop activity → target variable: {Names}.

  4. Inside the loop, add Type Text → value:

    =CONCAT("Hello ", {CurrentItem})

  5. Add a New Line or Enter Key after each loop.

  6. Play the process in Notepad.

Success Criteria:Each name appears on a new line as:

Hello Alex
Hello Ben
Hello Carla


5. Advanced Data Handling Scenarios

Working with Excel Data

Automize can read and write Excel files directly.

Typical process:

  1. Open an Excel File and select a Sheet.

  2. Loop through each row in the sheet.

  3. Use formulas inside the loop to combine or calculate data.

  4. Optionally write results back to a new Excel file.

Extracting Text from PDFs or Emails

  • Use PDF Extract data, OCR Extract TEXT from an image or Outlook Select an e-mail activities.

  • Store output in a {Text} variable.

  • Use formulas like =FIND("Invoice:", {Text}) to locate key values.

  • Pass those values to other steps.


Combining Variables and Formulas

You can assign the output of formulas to new variables:

{TaxAmount} = {Amount} * 0.15

{Total} = {Amount} + {TaxAmount}

Or concatenate strings dynamically:

{FileName} = CONCAT("Invoice_", {Date}, ".pdf")


6. Hands-On Challenges

Challenge 1 - Dynamic Calculator

Create a process that:

  1. Declares two variables {A} and {B}.

  2. Uses the formula =SUM({A},{B}).

  3. Types the result into Notepad.

Goal: The sum of the two numbers appears automatically.


Challenge 2 - Excel Automation

  1. Read a list of names from an Excel file.

  2. Loop through each name.

  3. Use Notepad or Outlook to greet each person by name.

Goal: Automize types or emails a personalised message for each name.


Challenge 3 - Smart Decision with Formula

Create a process that checks if {InvoiceTotal} > 1000.If true, type "High Value Invoice", otherwise "Standard Invoice".

Goal: Use an IF() formula in a Decision node or Text activity.


7. Best Practices for Variables and Loops

1. Keep Variables Scoped

Use clear variable naming and keep variables local where possible. Avoid reusing the same variable for unrelated data.


2. Default Initialisation

Always give variables an initial value - even if it's empty - to avoid "null" errors.


3. Keep Loops Efficient

  • Minimise the number of actions inside loops.

  • Avoid nested loops unless necessary.

  • Use indexing and counters carefully.


4. Keep Formulas Simple

  • Break long formulas into multiple smaller variables.

  • Test formulas using known values before deploying.

  • Document logic using notes.


5. Reuse and Modularise

Turn common logic (like totals or greetings) into sub-processes that can be reused across projects.


6. Follow Data Hygiene

  • Avoid hardcoded paths.

  • Use variables for file locations and credentials.

  • Validate inputs before looping over them.


7. Industry Standards

These are standard across major RPA platforms:

  • Prefer data-driven over screen-driven automations.

  • Maintain data in tables or variables instead of hardcoded values.

  • Reuse tested logic patterns (loops, conditionals, data transforms).

  • Keep your process readable and test small parts regularly.


End of Day 3 Summary

By completing Day 3, you should now be able to:

✅ Create and manage variables within Automize
✅ Use Excel-like formulas to transform and calculate data
✅ Loop through lists or data tables dynamically
✅ Combine variables and logic for smarter automation
✅ Apply best practices for efficiency and clarity


Next Step - Day 4

Learn how to test, debug, and read logs to ensure your automations run reliably - identifying, isolating, and fixing issues efficiently.
Next

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.