Using functions¶
Note
Functions are intended for advanced users.
When mapping items, you can use functions to create complex formulas. The functions available in Ibexa Connect are similar to functions in Excel or those in other programming languages. The functions let you perform various transformations of item values, such as converting a text to uppercase, trimming a text, converting a date into a different format, and many others.
Inserting functions into fields¶
Functions can be inserted into fields the same way as items. If you click into a field, the mapping panel will pop up.
The mapping panel contains several tabs:
-
The first tab (shown upon opening the panel) displays the items that you can map from other modules.
-
The other tabs contain various functions:
-
General functions - see General functions
-
Math functions - see Math functions
-
Text and binary functions - see String functions
-
Date and time - see Date & time functions
-
Functions for working with arrays - see Array functions
-
Ibexa Connect
-
To insert a function into a field, click the function name or drag it to the field.
Example: shortening a tweet¶
When posting a new tweet with the Twitter > Create a tweet module, you should not exceed Twitter's 140-character limit otherwise the module will throw en error. If you map a text item that can contain more than 140 characters into the module's Status field, you can use the substring()
function to limit the tweet to 140 characters:
Exploiting Google Sheets functions¶
If you miss a function, but it is featured by Google Sheets, you may exploit it like this:
-
In Google Sheets, create a new empty spreadsheet.
-
In Ibexa Connect, open your scenario.
-
Insert the Google Sheets > Update a cell module.
-
Configure the module:
-
Choose the newly created spreadsheet in the Spreadsheet field.
-
Insert your formula containing the Google Sheets function(s) into the Value field.
Note that you can use the output of preceding modules as usual.
-
-
Insert the Google Sheets > Get a cell module to obtain the calculated result.
-
Configure the module. Fill the same Cell ID as you filled in step 4.