Expressions

Functional Programming

5min

You can use JSONata Functional programming to compare values or display data based on certain conditions. You can quickly make any logical statements, and based on the result, you can perform different actions.

Configuration

Result

Expression

Determine if the value is bigger or smaller than a certain number

"[email protected] > 10 ? 'Number is bigger':'Number is lower'"

Variables

="<div style='font-size: 40px'>Welcome on board <b>" & @ctx.datasources.html.name & "</b> - " & @ctx.datasources.html.email & "</div>



Examples and code snippets 

Compare values

Functional expressions
Functional expressions


In this example we determine if the value for entity.field is bigger or smaller that 10.

See the full code sample in GitHub.

expression.jigx


Variables in content

Content
Content


This example shows how to write variables in HTML content.

See the full code sample in GitHub.

variablesInContent.jigx


Multiple select in a dropdown

Multiple selector expression
Multiple selector expression


In this example, we use the notation in which we select the instanceId of our component from the components, and extract the selected from the state of the component, then choose the required value. For example id, name,...

See the full code sample in GitHub.

multipleSelect.jigx




Updated 18 Sep 2023
Doc contributor
Did this page help you?