Building Apps with Jigx
...
Logic
Expressions

Expressions - cheatsheet

40min

 wants to help you build solutions quickly and easily. To help you do this, here is a list of functionality or data results you might want to use in your app with the expression used to achieve it. This is a starting point; you can adapt or add to the expression as needed to get the expected data results when building solutions. Refer to the Expressions section in the Examples tab for working examples and code snippets for various JSONata expressions.



Create Filters on a list (Path Operator expression)

YAML


Create Search for a list (Path Operator expression)

YAML


Create a placeholder (Boolean expression)

See tips and tricks when using placeholders for additional information.

YAML


Check if a field's value is Null (Boolean expression)

YAML

YAML

YAML


Evaluate PathsData (String Function expression)

YAML


Use evaluate to change data text to JSON object

YAML


Base64 image (String expression)

YAML


String to number (String expression)

YAML

YAML


Number to string (String expression)

YAML


Combining first and last name (Concatenate)

YAML


Splitting display name into first and last name (String expression)

YAML


Show text and split name and surname and only displaying name (String expression)

YAML


Show text followed by user's display name

YAML


Two letter placeholder for avatar (String expression)

YAML


True or False ? (Boolean expression)

YAML


Adding an expression into a string

YAML


Working with Date and Time expressions

Convert UTC to milliseconds

YAML


Convert millisecond to UTC

YAML


Transform any date to new format

YAML


Add days to date + convert to local timezone + format

YAML


Set date and time in datePicker to local timezone + format

YAML


Add days from current date and add additional time from current time

YAML


Get currently logged in user (Jigx system expression)

Results can include id, email, name.

YAML


Is the mobile device offline (Jigx system expression)

YAML


Get country flag icons using system (Jigx system expression)

Create a unique GUID

YAML


Formatting Numbers (Numeric functions)

YAML


Sorting an array of objects using a lambda (embedded) function

This example with data and the result can be viewed in JSONata exerciser.

YAML


Setting up complex objects with an embedded array

This example with data and the result can be viewed in JSONata exerciser.

YAML


Create a basic join on a static datasource to a local datasource  

YAML


Transform longitude and latitude data to show markers on a location component

YAML


Find the value relative to the current node so all paths are relative to it

YAML


 Find the value relative the root node of the supplied context, no matter what is the current node

 converts @ctx. to $$. when executing expressions in jsonata

YAML


Use the JSONata built-in index parameter combined with a filter

YAML


Update multiple records in execute-entities (operators > transform)

To update multiple records using the Execute-entities action, you can use the expression below.

YAML


Validate text fields using JSONata + Regex expression

See the examples provided in Regex expressions.

Use JavaScript functions in expressions

See more examples provided in JavaScript expressions.

YAML
JS


JavaScript checking any value for false

Checks for undefined, false, empty string, empty objects, null, empty array, and boolean false. It is better than using (jsonataTruthy) or $empty or $exist in JSONata as it checks for all scenarios and returns false in a single function, whereas using a combination of JSONata functions is necessary to return false.

JS




Updated 05 Nov 2024
Doc contributor
Did this page help you?