Expressions

1min

An overview and explanation of using expressions in

 is provided in the Expressions and Advanced Expressions section in the Guide tab.

Refer to the Expressions - cheatsheet for code snippets that can help you achieve a required result, such as creating a placeholder in a

.

In this section, examples with code snippets are provided for working with data using JSONata; these are:

JSONata

Example of use

Arrays

Create filtered lists from arrays and handling arrays with SQL and



Aggregation

To return the minimum, maximum, or average value in an array.

Boolean

Evaluate data to find a true or false result.

Compare values in data and use the value in a conditional logical expression, e.g., is an amount greater than 100.

Date & Time

Return a date and time in various formats, e.g., ISO 8601.

Navigate and access specific elements or properties within a data set, e.g., for filtering or searching.

Compare values or display data based on certain conditions and use logical statements, e.g., adding HTML variables in content or a multi-select as a functionParameter.



 variable set used in expressions to manipulate data specific to a

, e.g., determining the logged-in user or the organization and solution.

Used for query refinement.

String

String expressions have many uses, such as concatenating two strings to display multiple data records in one row, writing numbers as strings, or selecting only a few characters from the whole string.

Advanced expressions are helpful when you need to filter an array of records to display specific data and perform expression transformations over the data.

Create validation for text fields by combining JSONata and Regex expressions.

JavaScript functions allow you to write modular and reusable code, by encapsulating specific functionality within JavaScript functions and calling the function in an expression.



Updated 17 Sep 2024
Doc contributor
Did this page help you?