JSONata backend parser
Open source

JSONata backend parser (previously called Backend parser)

The JSONata parser allows you to transform and manipulate data using JSONata syntax.

Note

In previous versions of the data source, this was referred to as the backend parser. In the current version, the backend is a parser category that includes both JSONata and JQ parsers.

To use JSONata, select Backend → JSONata as the parser type in the query editor.

Setting the parser to JSONata enables features such as Alerting, Shared Dashboards, SQL Expressions, Query Caching, Recorded Queries.

Root selector/Field selector

Root selector allows you to manipulate the data received from the server. You can use JSONata style syntax in root selector to manipulate your data.

Computed fields

Once you have some fields already and you want to compute new field based on existing columns, you can use computed fields to do. This is something similar to the Add field from calculation -> Binary Operation transformation but enhanced with powerful expression language. For example price * qty gives the multiplication value of two columns names price and qty

calculated fields

Filter

If you want to filter data, you can use filter expressions. The expression should yield true or false. Example: price > 500, name != 'MacBook' && price != null, name IN ('MacBook','MacBook Air') and !(name IN ('MacBook','MacBook Air')) are valid filter expressions.

Filter expression

Summarize

Backend parser also supports summarizing the fields into a metric. For example, count(something) or max(some-other-thing) or mean([some other thing]) can be calculated from the array of data. You can also use numeric options such as sum,min,max,mean,first and last. You can also use expressions like sum(price) / count(id).

When specifying the field name, all special characters must be replaced with - and also transformed to lower case. Or the field name can also be specified within square brackets if they contain special characters. For example if the field name is Something Else!, then that can be specified like min(something-else-) or min([Something Else!]).

You can optionally specify the alias for the summarize expression using Summarize alias option. If nothing specified, summary will be used as alias. This alias will be helpful when you want to use merge transformation with results from different queries.