Day 7 - Data and Logic Deep Dive

Learn how to build intelligent, data-driven automations using variables, objects, loops, decisions, and Automize’s Excel-like formula engine - enabling your bots to make dynamic choices and manipulate data efficiently.

Help CentreGetting Started

Day 7 - Data and Logic Deep Dive

The goal is to learn how to build intelligent, data-driven automations using variables, objects, loops, decisions, and Automize's Excel-like formula engine - enabling your bots to make dynamic choices and manipulate data efficiently.


1. Why Logic Matters in Automation

Logic transforms a recorded sequence of steps into a smart process that adapts to changing data and conditions.

With logic, a bot can:

  • Decide what to do based on runtime values.

  • Process multi-level data objects.

  • Manipulate text, numbers, and dates dynamically.

  • Adapt to changing environments.


2. Data Types & Variables - including JSON Objects

Common Variable Types

TypeExampleDescription
Text"John Smith"Stores words or characters.
Number42Stores numeric values for calculations.
BooleanTRUE / FALSERepresents yes/no or true/false logic.
Date2025-11-12Stores date and time values.
Object (JSON){"Invoice": {"Lines": [{"Amount":100}], "Total":100}}Multi-level JSON object (see below).

Important: Automize uses JSON objects (not List/Table) for structured/multi-level data. Objects can nest multiple levels and are accessed using our object access syntax.


JSON Object Access Syntax

When a variable contains a JSON object, access nested values using any of the supported syntaxes:

  • {var::subvar::field}

  • {var:subvar}

  • {var.var}

  • {var|var}

  • {var||var}

  • {var->var}

All of the above are accepted and equivalent for accessing nested properties. Choose the style that matches your team's convention.

Example JSON object stored in {Invoice}

{ "Invoice": { "Header": { "Number": "INV-1001", "Date": "2025-11-12", "Customer": { "Name": "Acme Corp", "ID": "C123" } }, "Lines": [ {"SKU": "A1", "Qty": 2, "UnitPrice": 50}, {"SKU": "B2", "Qty": 1, "UnitPrice": 100} ], "Total": 200 }}

Access examples

  • {Invoice::Header::Number} → INV-1001

  • {Invoice:Header:Customer:Name} → Acme Corp

  • {Invoice.Header.Date} → 2025-11-12

  • {Invoice->Lines->0->UnitPrice} → 50 (first line item unit price)

  • {Invoice|Total} → 200

Note: When indexing arrays use numeric indexes: {Invoice::Lines::0::SKU}.


Casting Variables

You can force a variable to be treated as a specific type using casting syntax:

  • {INT:var} - convert var to integer

  • {FLOAT:var} - convert var to float/decimal

  • {STR:var} - convert var to string

Examples

  • {INT:{Invoice::Total}} → Converts total to integer

  • =SUM({FLOAT:Price1},{FLOAT:Price2}) → Forces numeric addition even if inputs were text


Special Built-In Objects

Automize includes domain-specific objects you can work with directly (examples):

  • Invoices - see help/working-with-invoices-1

  • Quotes - see help/help/working-with-quotes-1

  • Purchase Orders - see help/working-with-purchase-orders-1

These objects are structured JSON and expose fields relevant to that document type (header, lines, totals, supplier, etc.). Use the same multi-level access syntax to read/write their fields.


Excel-like Functions

For all supported calculation and string functions refer to:

  • Help: help/what-calculation-functions-are-supported-1

This page documents the full list (CONCAT, IF, SUM, LEFT, RIGHT, MID, FIND, LEN, DATEDIF, etc.) and examples for using them inside Automize formulas.


3. Working with Variables and Objects - Hands-On

Exercise 1 - Create and Read an Object

  1. Create a new process "Invoice Read Demo".

  2. Add a Set Variable activity:

    • Variable: {Invoice}

    • Value: paste the example JSON above (or your own invoice JSON).

  3. Add Log Message activities to output:

    • Log: "Invoice Number: {Invoice::Header::Number}"

    • Log: "Customer: {Invoice::Header::Customer::Name}"

    • Log: "First Line SKU: {Invoice::Lines::0::SKU}"

  4. Run the process.

Goal: Logs display the correct nested values.


Exercise 2 - Casting and Calculation

  1. Add variables: {Price1} = "100.50", {Price2} = "49.50".

  2. Add a Formula activity:

    • Formula: =SUM({FLOAT:Price1},{FLOAT:Price2})

    • Output: {Total}

  3. Log: Log: "Total = {Total}".

Goal: Total logs as 150.0 (numeric addition after casting).


4. Formula Engine & Practical Examples

Common Formula Patterns

  • Concatenate nested fields:

    =CONCAT({Invoice::Header::Customer::Name}, " - ", {Invoice::Header::Number})

  • Conditional logic on object fields:

    =IF({INT:Invoice::Total} > 1000, "High", "Normal")

  • Pull a date and format (example using supported date functions):

    =TEXT({Invoice::Header::Date},"yyyy-mm-dd")

See help/what-calculation-functions-are-supported-1 for full function list and syntax.


5. Decisions using Objects

Example decision: If an invoice's total is over 1000 then send for approval.

  1. Add a Decision activity with condition:

    {INT:Invoice::Total} > 1000

  2. True connector → Approve flow.

  3. False connector → Normal flow.

Connector colours:

  • Always - Blue

  • Default / True - Green

  • False - Amber

  • Exception - Red

Use colours to visually identify connector types on the process map.


6. Loops with Objects

Process a list of invoices represented as an object array:

Example object

{ "Invoices": [ {"ID":"INV1","Total":500}, {"ID":"INV2","Total":1500} ]}

For Each loop

  • Input: {Invoices}

  • Item variable: {CurrentInvoice}

  • Inside loop you can reference: {CurrentInvoice::ID}, {CurrentInvoice::Total}

Hands-On Exercise - Invoice Loop

  1. Set variable {Invoices} to example JSON.

  2. For Each {CurrentInvoice} in {Invoices}:

    • Decision: {INT:CurrentInvoice::Total} > 1000

    • True → Log: "Invoice {CurrentInvoice::ID} is High Value"

    • False → Log: "Invoice {CurrentInvoice::ID} is Normal"

Goal: Correctly logs classification per invoice.


7. Variable Syntax Variants - Quick Reference

All of the following are supported for accessing nested values:

  • {var::sub::field}

  • {var:sub}

  • {var.var}

  • {var|var}

  • {var||var}

  • {var->var}

Casting examples

  • {INT:var} - integer

  • {FLOAT:var} - floating point

  • {STR:var} - string

Array indexing

  • {Object::Array::0::Field} - first item in Array.


8. Special Objects - Usage Notes

  • Invoices: Use for payment processes, reconciliation, and approvals. (See help/working-with-invoices-1)

  • Quotes: Use for sales quoting automations. (See help/help/working-with-quotes-1)

  • Purchase Orders: Use for procurement automations. (See help/working-with-purchase-orders-1)

Each special object exposes expected fields and helper functions. Use the object-specific help pages for field names and example payloads.


9. Best Practices - Objects & Logic

  • Keep object schemas consistent across processes (same field names/structures).

  • Prefer objects over many flat variables for complex data - they're easier to pass and extend.

  • Always cast before numeric ops: use {INT:}, {FLOAT:} to avoid errors from string values.

  • Log key object fields at start/end of processing for auditability.

  • Avoid deep inline formulas - break into intermediary variables for clarity and debugging.


End of Day 7 Summary

By completing the updated Day 7, you should now be able to:

✅ Use JSON objects as your primary structured data type✅ Access nested fields using multiple supported syntaxes✅ Cast variables explicitly for safe calculations✅ Combine objects with formulas, loops, and decisions✅ Use built-in domain objects (Invoices, Quotes, POs) and consult their help pages✅ Recognise connector types and their colours (Always - Blue, Default/True - Green, False - Amber, Exception - Red)


Next Step - Day 8

If you want, I'll build Day 8 - Reporting, Analytics & Continuous Improvement next, including how to extract KPIs from logs, build dashboards, and run periodic health checks on your automations.

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.