Advanced JSONata Functions
The earlier chapters use a small set of JSONata syntax to get results from the data. This chapter covers the built-in functions that appear frequently in production DAQS rules — what they do, when to use them, and how they combine with the patterns you already know.
What you will learn
- How
$map()transforms arrays element by element - How
$split(),$substring(), and$string()handle text - How
$count()and$sum()enable duplicate detection and aggregation - How
$boolean()and$number()convert values between types - How to use the applicability gate — filtering output on a computed boolean
- How to validate that two fields belong together
- How to drop non-matching elements from a join using
() - How to test list membership with
in
Pages in this section
String Functions
$split(), $substring(), $string(), and $trim() — the text operations used in name-parsing rules.
Count and Aggregation
$count() and $sum() for duplicate detection, summarising results, and array membership checks.
Map Function
$map() for transforming arrays into new shapes.
Type Coercion
$boolean() and $number() — converting values between types, especially for shared boolean parameters.
Applicability Gate
The [condition] filter after a projection — how to return only elements where a computed field is true.
Two-Field Consistency
How to compute { checkApplicable, isEqual } objects for cross-field validation rules.
Join Filter Pattern
How $sym ? {...} : () silently drops unmatched elements in cross-type joins.
In Operator
Testing list membership with in — in filter predicates, parent ID sets, and GUID lists.
Prerequisites
You should be comfortable with the core filter patterns from Filters and understand how DAQS validators work — see Validating.