Advanced expressions are useful when you must filter your array of records to display specific data and do any expression transformations over the data. So instead of writing complicated procedures and statements, you can run JSONata expressions to get the result. You can format the expression strings and have them inline or multiline.
When you are writing advanced expressions, make sure you have the expression starting with '=' inside the quotes, as shown below:
You can write advanced expressions as multiline, for better readability and cleaner code formatting. When writing a multiline expression, make sure you have the expression in quotes and the next line must be indented on the same level as shown below.
We will display a list of people from the array of records, then filter them and display those that have entered a name. We will display their initials as a left avatar and add a label to each list item that will display whether they are registered or not.
See the full example in GitHub.
As part of advanced expressions, you can define functions that will run the expressions. It can be a function for date transformations, maths calculations, or any string transformations. By using functions you will have cleaner code that is easier to read.
This example shows a simple function that will divide the number from the datasource.
See the full code sample in GitHub.