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
| Type | Description | Example |
|---|---|---|
| Text | Words or characters | "Invoice 001" |
| Number | Numeric values | 123 or 45.67 |
| Boolean | True or False | TRUE |
| Date / Time | Time-based data | 2025-11-12 08:30 |
| Object | A 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:
During recording - Automize automatically creates variables for dynamic fields.
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
| Formula | Description |
|---|---|
| =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:
Open the Automize Bot → Record a new process named "Greeting Formula".
Open Notepad.
Stop recording and open the process in the Web Portal.
Edit the process and add a new Keyboard → Write activity.
Create two variables:
{UserName} = "Alex"
{Items} = 3
In the Text to Type field, enter:
=CONCAT("Hello ", {UserName}, "! You have ", {Items}, " items pending.")
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
Click on the top right button:{{buttons:processes/edit}}
Select the + Activity option
Select RPA at the top, and then Loop from the Actions, and select on of the Loop options.
- The following popup will appear: {{popups:rpas/add:action=loop-files}}
Complete the form (especially the conditions as and when they apply) and press Add.
Connect the loop to other activities as required.
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:
Create a new process called "Loop Names".
Add a variable {Names} = ["Alex","Ben","Carla"].
Add a Loop activity → target variable: {Names}.
Inside the loop, add Type Text → value:
=CONCAT("Hello ", {CurrentItem})
Add a New Line or Enter Key after each loop.
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:
Open an Excel File and select a Sheet.
Loop through each row in the sheet.
Use formulas inside the loop to combine or calculate data.
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:
Declares two variables {A} and {B}.
Uses the formula =SUM({A},{B}).
Types the result into Notepad.
Goal: The sum of the two numbers appears automatically.
Challenge 2 - Excel Automation
Read a list of names from an Excel file.
Loop through each name.
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