Functions

The functions are very useful for modifying data that comes from the data provider, an API or a component.

This list is not exhaustive and is mostly temporary: it will be replaced very soon by a visual interface.

Collection & Array

getByIndex: finds the item of a list from its index. For example: "I want the 3rd element".

[data:1234(/myCollection/@getByIndex:3)] 

When you are in a collection, you can get the current index with the magic expression: [data:(rowIndex)]

getById: retrieves a list item from its unique identifier. For example: "I want the element that has this identifier".

[data:1234(/myCollection/@getById:a7b8)] 

When you are in a collection, you can get the current identifier with the magic expression: [data:(rowId)]

count: counts the number of elements.

[data:1234(/myCollection/@count:)]

merge: combines two collections in one.

[data:1234(/myCollection/@merge:[data:1234(/myOtherCollection)])]

groupBy: groups the data according to a criterion. For example by author.

[data:1234(/myCollection/@groupBy:|author|name)] 

You can combine expressions. For example to count the number of articles of Fran├žois:
[data:1234(/myCollection/@groupBy:|author|name/Fran├žois/@count:)]

uniqBy: removes duplicates according to a criterion. Keeps only one article per author. r. 

[data:1234(/myCollection/@uniqBy:|author|name)]

Number

add: adds to a number.

[data:1234(/myNumber/@add:1)]

subtract: subtracts from a number.

[data:1234(/myNumber/@subtract:1)]

multiply: multiplies to a number.

[data:1234(/myNumber/@multiply:2)]

divide: divides to a number.

[data:1234(/myNumber/@divide:2)]

formatNumber: allows you to display a number naturally according to the project language..

[data:5ff6e0e1a1914461d600062a(/myNumber/@formatNumber:*minimumFractionDigits|1|maximumFractionDigits|2)]

Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat
minimumFractionDigits
maximumFractionDigits

Character string

truncate: limits the number of characters in a text by adding ... 34 is the maximum length

[data:1234(/myTitle/@truncate:34)]

Date

formatDate: allows you to display a date naturally according to the language of the project.

[data:1234(/myTimeStampInSeconds/@multiply:1000/@formatDate:dateStyle|medium)]<br>

Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat
dateStyle
timeStyle

Still need help? Contact Us Contact Us