Expressions
With this feature, you can define a dynamic value for a block based on the data from:
table
Retrive data from the Table
table
variables
Retrive data from the Variables
variables.<variableName>
loopData
Retrive the current iteration data of the Loop Data block
loopData.<loopId>
prevBlockData
Retrive the data of the previous block
prevBlockData
globalData
Retrive the global data of the workflow
globalData
googleSheets
Retrive the Google Sheets data
googleSheets.<referenceKey>
activeTabUrl
Retrive the active tab url
activeTabUrl
workflow
Retrive the data (Table and Variables) of the workflow that have been run by the Execute Workflow block
workflow.<executeId>
GoLess uses a mustache templating model and expands it with data from overhead and functions.
Writing Expression
To write an expression, you should use the following format: "{{ keyword }}". Change the keyword with one of the data sources mentioned above. It helps GoLess distinguish static from dynamic data.
For example, assume that you have a variable named socials inside the workflow. Its value is an array of objects. You can use the HTTP Request block to send this variable to the API.
The following phrase can be used in the body of the HTTP Request block:
{{variables.socials}}
If you want to use the url property on the first element of the array as a value inside the New Tab block URL, you can use the following expression:

The first element of the array here is expressed as 0. Use 1 for the 2nd element of the array, 2 for the 3rd element, 3 for the 4th element, etc.
Access Another Data Inside the Expressions
Wrap the expression with a bracket ([]) to access other data inside the expression. For instance, let's take the situation when you want to increment a variable using the $increment function or get the table row based on the current index of the loop. In this case, you can write the expressions as follows:
Functions
All built-in functions always begin with the prefix $, for instance, $funcName(param); here is a reference list of available functions in GoLess.
$date(date, dateFormat?)
$date(date, dateFormat?)This fuction gets or formats a date. It takes two parameters, the second parameter is optional.
Suppose you want to format the current date. In that case, you can pass the dateFormat straight as the first parameter. For example,{{ $date('DD-MMMM-YYYY') }}, and the output would be 14-January-2022. You can check all the available date formats on the day.js page.
Also, you can check the valid date format on the MDN page for the date parameter.
Examples
$randint(min?, max?)
$randint(min?, max?)Produces a random number. You can set up the range of the random number by entering the min and max parameters.
Examples
$getLength(str)
$getLength(str)Gets the length of an array or string.
Examples
$randData(expression)
$randData(expression)This function generates random data. Pass an expression to its parameter and it will generate something random. For instance, $randData("?l") will produce a random minuscule letter like a. Supported expressions:
?l: lowercase?u: uppercase?d: number?f: uppercase + lowercase?s: symbol?m: uppercase + number?n: lowercase + number?a: any
You can also mix several expressions together. For example, $randData("[email protected]") will produce [email protected].
Examples
$multiply(value, multiplyBy)
$multiply(value, multiplyBy)Multiplies a value.
Examples
$increment(value, incrementBy)
$increment(value, incrementBy)Increments a value.
Examples
$divide(value, incrementBy)
$divide(value, incrementBy)Divides a value.
Examples
$subtract(value, incrementBy)
$subtract(value, incrementBy)Subtracts a value.
Examples
$replace(value, search, replace)
$replace(value, search, replace)Replaces a search string from value with a replace string.
Examples
$replaceAll(value, search, replace)
$replaceAll(value, search, replace)Replaces all the matches string search from value with a replace string.
Examples
$toLowerCase(value)
$toLowerCase(value)Converts value to a lowercase
Examples
$toUpperCase(value)
$toUpperCase(value)Converts value to a uppercase
Examples
$modulo(num, divisor)
$modulo(num, divisor)Returns the remainder or signed remainder of a division.
Examples
$filter(data, syntax)
$filter(data, syntax)Filter/Query javascript object. GoLess uses the JSONPath library to make a query.
data: Javascript object to querysyntax: JSONPath Syntax
Examples
Querying colors variable with these as the value:
Using JS Expressions
$stringify(value)
$stringify(value)Converts JavaScript value to a JSON string.
Examples
This section gives further examples of writing expressions and provides some information about the structure of the source data.
Table
The table is stored as an array of objects with the table column as the object key.
Get the first row: expression:
{{ table.0 }}output:{ "color": "blue", "value": "#00f" }Get the second row: expression:
{{ table.1 }}output:{ "color": "cyan", "value": "#0ff" }Get the last row: expression:
{{ table.$last }}output:{ "color": "black", "value": "#000" }Get value of the
colorcolumn on the first row: expression:{{ table.0.color }}output:blueGet value of the
valuecolumn on the first row: expression:{{ table.0.value }}output:#00f
Variables
The variables are stored as an object with the variable title as the object key.
Get the value of the
urlvariable: expression:{{ variables.url }}output:https://goless.comGet the value of the
numbersvariable: expression:{{ variables.numbers }}output:[100, 500, 300, 200, 400]Get the first number of the
numbersvariable: expression:{{ variables.numbers.0 }}output:100
JavaScript Expressions
::: Note: this is only supported in the browsers based on Google Chromium :::
With GoLess, you also use javascript within the expressions. To write a javascript, you must add !! symbols as the first value on a text field of a block. For instance, from The number is: {{variables.number}} to!!The number is: {{variables.number}}.

You can also use the integrated function like the javascript function.
Examples
Use of integrated functionality:
Get the last row of the table:
Get current timestamp:
Access loop data and index:
Last updated