Skip to main content

Examples

Every mapping on this page was run through the resolver the flow uses, against the data shown. The outputs are what the engine returned, including the awkward parts.

Building a message payload

Query, concatenation and a nested object in one mapping. $.…items.length counts an array; $.…items[*].sku collects a field from every element.
total stays a number and line_count stays an integer. Only the two | strings become text.

Filtering a list

The same mapping, three filters, three different result shapes.
high_open_ids is a bare string, not a one-item list, because exactly one row matched. Add a fourth high-priority open ticket and the same expression returns an array. A step reading this value has to handle a string, a list and [].
Note also what is not expressible here. [?(@.priority==='high' || @.priority==='urgent')] fails the step — the | characters are consumed as concatenation delimiters before JSONPath sees them. Two separate keys, or an Eval step, are the way round it.

Flattening a nested response

A JSONPath key is resolved like any other expression, so a record can be keyed by a value from the run.
phone is the four-character string "null", not an empty string — the property exists and holds null, and a trailing | stringifies whatever it finds. Only a path that matches nothing produces "".

Searching a tree

.. finds a field at any depth. @root reaches back to the whole data object from inside a filter.
Writing $.trigger.region inside the filter instead of @root.trigger.region fails the step with $ is not defined.

Building a URL

Concatenation joins literal text with resolved values. $.static holds the flow’s Static Data and $.env holds the run’s own metadata.

What a missing value looks like

The key is never dropped. Without a trailing | a missing value is an empty array; with one it is an empty string.

Next steps

JSONPath

Every selector and filter that works

Concatenation

Building strings with |

Map Step

The step whose entire job is a mapping

Eval Step

Logic that JSONPath cannot express