Help

Functions

When mapping items, you can use functions. The functions available in Integromat are used similarly as Excel functions or those in programming languages. The functions let you perform various changes to items, such as changing a bundle item to upper case, cutting selected text to a required size, converting a date into different format and many others. Functions are intended for advanced users.

Example: Cutting Tweet text

When writing a new Tweet, you should not exceed the Twitter's 140-character limit. If you create a scenario with a Tweet containing more characters, the scenario run will terminate with an error. If you map a text item that can contain more than 140 characters to be the source field for the Tweet, you may want to use the substring() function that will remove the characters over the limit.


Inserting a function into a field

You insert functions in the same way as you map items. Clicking a target field will open the mapping panel which is divided into several sections. You can switch between them by clicking. The first section (shown upon opening the panel) displays the items that you can map from other modules. In the other sections, you will find different types of available functions.

To insert a function into a field, click the function name or drag it to the target field.


Text functions

base64(text)

Transforms text to base64.

base64(integromat) 
= aW50ZWdyb21hdA==

decodeURL(text)

Decodes special characters in URL to text.

decodeURL(Automate%20your%20workflow) 
= Automate your workflow

encodeURL(text)

Encodes special characters in text to valid URL address.

escapeHTML(text)

Escapes all HTML tags in text.

escapeHTML(<b>Hello</b>) 
= &lt;b&gt;Hello&lt;/b&gt;

lower (text)

Converts all alphabetic characters in a text string to lowercase.

lower(Hello)
= hello

md5(text)

Calculates the md5 hash of a string.

md5(integromat) 
= d155951844a40fb856108d803d4de33e

replace(text;search string, replacement string)

Replaces the search string with the new string.

replace(Hello World;Hello;Hi) 
= Hi World

sha1(text)

Calculates the sha1 hash of a string.

sha1(integromat) 
= 5572e727b5822e06d7d13c69f51b3addbfa5390f

split(text, separator)

Splits a string into an array of strings by separating the string into substrings.

split(John,George,Paul; ,)

stripHTML(text)

Removes all HTML tags from text.

stripHTML("<b>Hello</b>")
= Hello

substring(text; start;end)

Returns a portion of a text string between the "start" position and " the end" position..

substring(Hello;0;3) 
= Hel
substring(Hello;1;3)  
= el

toBinary(value)

Converts any value to binary data. You can also specify encoding as a second argument to apply binary conversions from hex or base64 to binary data.

toBinary(Integromat) 
= 496e746567726f6d6174
toBinary(SW50ZWdyb21hdA==; base64) 
= 496e746567726f6d6174

toString(value)

Converts any value to string.

trim(text)

Removes space characters at the start or end of the text.

upper(text)

Converts all alphabetic characters in a text string to uppercase.

upper(Hello) 
= HELLO

Math functions

average([array of values]), average(value1, value2, ...)

Returns the average value of the numeric values in a specific array, or the average value of numerical values entered individually.

ceil(number)

Returns the smallest integer greater than or equal to a specified number.

ceil(1.2) 
= 2
ceil(4) 
= 4

floor(number)

Returns the largest integer less than or equal to a specified number.

floor(1.2) 
= 1
floor(1.9) 
= 1
floor(4) 
= 4

max([array of values]), max(value1;value2; ...)

Returns the largest number in a specified array, or the largest number among numbers entered individually.

min([array of values]), min(value1; value2; ...)

Returns the smallest number in a specified array, or the smallest number among numbers entered individually.

parseNumber(number; decimal separator)

Parses a string with a number and returns the number. Example: parseNumber(1 756,456;,)

round(number)

Rounds a numeric value to the nearest integer.

round(1.2) 
= 1
round(1.5) 
= 2
round(1.7) 
= 2
round(2) 
= 2

sum([array of values]), sum(value1; value2; ...)

Returns the sum of the values in a specified array, or the sum of numbers entered individually.

Date and time

addDays(date; number)

Returns a new date that results from adding a given number of days to a date. To substract days, enter a negative number.

addDays(2016-12-08T15:55:57.536Z; 2) 
= 2016-12-10T15:55:57.536Z
addDays(2016-12-08T15:55:57.536Z; -2) 
= 2016-12-6T15:55:57.536Z

addHours(date; number)

Returns a new date that results from adding a given number of hours. To substract hours, enter a negative number.

addHours(2016-12-08T15:55:57.536Z; 2) 
= 2016-12-08T17:55:57.536Z
addHours(2016-12-08T15:55:57.536Z; -2) 
= 2016-12-08T13:55:57.536Z

addMinutes(date; number)

Returns a new date that results from adding a given number of minutes. To substract minutes, enter a negative number.

addMinutes(2016-12-08T15:55:57.536Z; 2) 
= 2016-12-08T15:57:57.536Z
addMinutes(2016-12-08T15:55:57.536Z; -2) 
= 2016-12-08T15:53:57.536Z

addMonths(date; number)

Returns a new date that results from adding a given number of months. To substract months, enter a negative number.

addMonths(2016-08-08T15:55:57.536Z; 2) 
= 2016-12-10T15:55:57.536Z
addMonths(2016-08-08T15:55:57.536Z; -2) 
= 2016-12-06T15:55:57.536Z

addYears(datum;years)

Returns a new date that results from adding a given number of years. To substract years, enter a negative number.

addYears(2016-08-08T15:55:57.536Z; 2) 
= 2018-08-08T15:55:57.536Z
addYears(2016-08-08T15:55:57.536Z; -2) 
= 2014-08-08T15:55:57.536Z

formatDate(date; format; [timezone])

Returns a date in the requested format and optionally in specified timezone. For example, format DD.MM.YYYY HH:mm

formatDate(2016-12-28T16:03:06.372Z; MM/DD/YYYY)  
= 12/28/2016
formatDate(2016-12-28T16:03:06.372Z; YYYY-MM-DD HH:mm)  
= 2016-12-28 17:03
formatDate(2016-12-28T16:03:06.372Z; DD.MM.YYYY HH:mm)  
= 28.12.2016 17:03

parseDate(date; format; [timezone])

Parses a string with a date and returns the date. E.g.parseDate(28.05.2000;MM.DD.YYYY)

Function for working with arrays

add(array; value1; value2; ...)

Adds values specified in parameters to an array.

join(array; separator)

Concatenates all the items of an array into string, using the specified separator between each item.

remove(array; value1; value2; ...)

Removes values specified in parameters from an array. Effective only on primitive arrays of text or numbers.

slice(array; start; [end])

Returns a new array containing only selected items.

Rate this article: