Skip to content
On this page



If you're using v1.21.x or below {{ keyword@path }} syntax is still supported in v1.22.x

This feature allows you to set a dynamic value for a block based on data from:

NameDescriptionAccess item
tableGet data from the Tabletable
variablesGet data from the Variablesvariables.<variableName>
loopDataGet the current iteration data of the Loop Data blockloopData.<loopId>
prevBlockDataGet the data of the previous blockprevBlockData
globalDataGet the global data of the workflowglobalData
googleSheetsGet the Google Sheets datagoogleSheets.<referenceKey>
activeTabUrlGet the active tab urlactiveTabUrl
workflowGet the data (Table and Variables) of the workflow that have been execute by the Execute Workflow blockworkflow.<executeId>

Automa uses mustache templating and extends it with data from above and functions.

Writing Expression

To write an expression, you must follow this format "{{ keyword }}"; and replace the keyword with one of the above data sources. It allows Automa to differentiate between static and dynamic data.

Let's say you have a variable inside the workflow, and the variable name is socials; its value is an array of objects. You want to send this variable to an API using the HTTP Request block.

  { "name": "GitHub", "url": "" },
  { "name": "Twitter", "url": "" },
  { "name": "Discord", "url": "" }

You can use the following expression inside the HTTP Request block body:


HTTP Request block body

But what if you want to use the url property on the first element of the array as a value inside the New Tab block URL? For that, use the following expression:


New tab block URL

0 on that expression means the first element of the array. And if you want to get the second element of the array, replace it with 1. 2 for the third element; 3 for the fourth element; and so on.

Access Another Data Inside the Expressions

To access other data inside the expression, you must wrap the expression for accessing the data with a bracket ([]). For example, when you want to increment a variable using the $increment function or get the table row based on the current index of the loop. You can write the expressions like:




All built-in functions always start with the prefix $; for example, $funcName(param); And here are reference list of available functions in Automa.

$date(date, dateFormat?)

Get or format a date. This function takes two parameters, which the second parameter is optional.

If you want to format the current date, you can directly pass the dateFormat as the first parameter, like {{ $date('DD-MMMM-YYYY') }}, and the output would be 14-January-2022. See all the available date formats on the day.js page.

And for the date parameter, see the valid date format on the MDN page.


$date("DD MMMM YYYY") // 14 January 2022
$date("DD-MM-YYYY, hh:mm A")  // 14-01-2022, 02:24 PM
$date("relative") // A few seconds ago
$date("timestamp") // 1651118110948

$date("2005-06-07", "DD MMMM YYYY") // 07 June 2005
$date("1977-04-01T14:00:30", "DD-MM-YYYY, hh:mm A")  // 01-04-1977, 02:00 PM
$date("14 January 2021", "relative") // A year ago
$date("14 January 2021", "timestamp") // 1610553600000

$randint(min?, max?)

Generate a random number. You can change the range of the random number by inputting the min and max parameters.


$randint() // 30
$randint() // 14

$randint(0, 10) // 4
$randint(0, 10) // 7


Get the length of a string or array.


// Get the length of a string
$getLength("testing") // 7

// Get tabel length
$getLength([table]) // 14

// Get the length of the "text" column on the second row
$getLength([table.1.text]) // 5


A function to generate random data, you only need to pass an expression to its parameter. For example, $randData("?l") will generate a random lowercase letter like a. Supported expression:

  • ?l: lowercase
  • ?u: uppercase
  • ?d: digit
  • ?f: uppercase + lowercase
  • ?s: symbol
  • ?m: uppercase + digit
  • ?n: lowercase + digit
  • ?a: any

You can also combine these expressions like $randData("?u?l?l?l?l?d?") which will generate


$randData("?d?d") // 89

$randData("?l?l?l?d?") //

$randData("?d?u?s?l?l?s?a?m") // 4C%ee^MF9

$multiply(value, multiplyBy)

Is used to multiply a value.


$multiply(5, 2) // 10

// Multiply a variable
$multiply([variables.variableName], 0.3) //20.7

$increment(value, incrementBy)

Is used to increment a value.


$increment(10, 2) // 12

$increment(72, 2) // 74

$divide(value, incrementBy)

Is used to divide a value.


$divide(22, 7) // 3.142857142857143

$divide(10, 2) // 5

$subtract(value, incrementBy)

Is used to subtract a value.


$subtract(80, 7) // 73

$subtract(11, 2) // 9

$replace(value, search, replace)

Is used to replace a string search from value to be replace string.


$replace("hello world!", "world", "everyone") // hello everyone!

$replace("hello world!", "hello", "hi") // hi world!


Is used to lowercase a value.


$toLowerCase("HELLO WORLD!") // hello world!

$toLowerCase("hELLO wORLD!") // hello world!


Is used to uppercase a value.


$toUpperCase("hello world!") // HELLO WORLD!

$toUpperCase("hELLO wORLD!") // HELLO WORLD!

$modulo(num, divisor)

Returns the remainder or signed remainder of a division.


$modulo(13, 5) // 3

$modulo(-13, 5) // -3

$modulo(4, 2) // 0

$modulo(-4, 2) // -0

$filter(data, syntax)

Filter/Query javascript object. Automa is using JSONPath library to do querying.


Querying colors variable with these as the value:

	{ color: "red", value: "#f00" },
	{ color: "green", value: "#0f0" },
	{ color: "blue", value: "#00f" },
	{ color: "cyan", value: "#0ff" },
	{ color: "magenta", value: "#f0f" },
	{ color: "yellow", value: "#ff0" },
	{ color: "black", value: "#000" }
{{ $filter([variables.colors], "$..color") }}
// ['red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black']

{{ $filter([variables.colors], "$..value") }}
// ['#f00', '#0f0', '#00f', '#0ff', '#f0f', '#ff0', '#000']

Using JS Expressions

!!{{ $filter(variables.colors, "$..color") }}
// ['red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'black']

!!{{ $filter(variables.colors, "$..value") }}
// ['#f00', '#0f0', '#00f', '#0ff', '#f0f', '#ff0', '#000']


Convert JavaScript value to a JSON string.


This section provides more examples of how to write expressions. And the data structure of the source data.


The table is stored as an array of objects with the table column as the object key.

  { "color": "blue", "value": "#00f" },
  { "color": "cyan", "value": "#0ff" },
  { "color": "magenta", "value": "#f0f" },
  { "color": "yellow", "value": "#ff0" },
  { "color": "black", "value": "#000" }
  • Get the first row of the table.
    expression: {{ table.0 }}
    output: { "color": "blue", "value": "#00f" }

  • Get the second row of the table.
    expression: {{ table.1 }}
    output: { "color": "cyan", "value": "#0ff" }

  • Get the last row of the table.
    expression: {{ table.$last }}
    output: { "color": "black", "value": "#000" }

  • Get value of the color column on the first row of the table.
    expression: {{ table.0.color }}
    output: blue

  • Get value of the value column on the first row of the table.
    expression: {{ table.0.value }}
    output: #00f


The variables is stored as an object with the variable name as the object key.

  "url": "",
  "numbers": [100, 500, 300, 200, 400]
  • Get value of the url variable.
    expression: {{ variables.url }}

  • Get value of the numbers variable.
    expression: {{ variables.numbers }}
    output: [100, 500, 300, 200, 400]

  • Get the first number of the numbers variable.
    expression: {{ variables.numbers.0 }}
    output: 100

JavaScript Expressions


Only supported in the chromium based browser

Automa also supports javascript within the expression, but to write a javascript, you must add !! characters as the first value on a text field of a block. For example, from The number is: {{variables.number}} to !!The number is: {{variables.number}}.

JS Expression

And you can use the built-in function the same as the javascript function.


  • Using the built-in function
{{$getLength(table)}} //10

{{$randData("?d?d")}} // 89
  • Get the last table row
{{table[table.length - 1].columnName}}
  • Get current timestamp
{{}} //1666237704022

  • Access loop data and index
// Loop data

// Loop index