Escribal
Back to Docs

JSON

Querying

This group asks questions about a loaded JSON document without changing it. Each instruction inspects the data — counting elements in a list, filtering a list by field conditions, checking whether a list is empty, or picking out values with a query expression — and saves the answer for later steps to use. Most of them work on a named list (array) inside the document.

Prerequisite: a JSON document must already be loaded — created with Create JSON file or opened with one of the Opening instructions (for example Open JSON File). These instructions only read; they never create a document.

These concepts recur across the instructions in this group; they are explained here once.

  • This group only reads. Nothing in the document is changed. The Save … field is the way to capture the answer — if you leave it empty, the instruction runs but the result is discarded. Save it under a name and later steps can use it with @name.
  • Document: the Document key names the loaded document to query. If you leave it empty, the current document is used. It also accepts @name.
  • The list to work on (Array field name): most instructions operate on a list held under a named field in the document — for example the items list (the default). The instruction looks up that field and expects it to be a list; if the field is missing or isn’t a list, the instruction does nothing (see each instruction’s notes).
  • Text is matched ignoring upper/lower case, and values are compared as text (with the numeric comparisons in Count Matching Elements being the exception).
  • Dynamic values @name: the text fields — Document key, Array field name, Field name, Match value, Field 1/2, Value 1/2 and JSONPath — accept a saved value: type @ followed by its name and the engine substitutes the value at run time. The Comparison, Logical operator and Save … fields are plain text.

Count Matching Elements .json

Counts how many elements in a list match a condition and saves the number. The condition compares either a named field of each element (when Field name is given) or the element itself (when it is left empty, for a list of plain values).

When to use it: to get a total that a later step can branch on — for example how many orders have status shipped, or how many numbers are greater than a threshold.

Parameter Meaning Default Required
Document key The loaded document to query. Empty = current document (accepts @name) (empty) No
Array field name The field holding the list to count over (accepts @name) items No
Field name The field of each element to compare; empty = compare the element itself (accepts @name) (empty) No
Match value The value to compare against (accepts @name) (empty) No
Comparison How to compare: equals, not-equals, contains, starts-with, ends-with, greater-than, less-than equals No
Save count key Saves the resulting count under this name (empty) No

Important behavior: the document must be an object containing the named list, otherwise nothing happens and no count is saved. greater-than and less-than only match when both sides are numbers; any other comparison compares as text, ignoring case. If Field name is empty, elements that are objects are skipped (leave it empty only for lists of plain values like text or numbers). An unrecognized Comparison matches nothing (count 0).


Find With Compound Condition .json

Filters a list, keeping the elements that satisfy up to two field conditions joined by AND or OR, and saves the matching elements as a new list.

When to use it: to pull out a subset of records — for example customers where country is ES and active is true — for a later step to process or save.

Parameter Meaning Default Required
Document key The loaded document to query. Empty = current document (accepts @name) (empty) No
Array field name The field holding the list to filter (accepts @name) items No
Field 1 The first field to test on each element (accepts @name) (empty) No
Value 1 The value Field 1 must equal (accepts @name) (empty) No
Field 2 The second field to test on each element (accepts @name) (empty) No
Value 2 The value Field 2 must equal (accepts @name) (empty) No
Logical operator How the two conditions combine: AND (both) or OR (either) AND No
Save key Saves the list of matching elements under this name (empty) No

Important behavior: the document must be an object containing the named list, otherwise nothing happens and nothing is saved. Each condition tests equality only (ignoring case). A condition whose field or value is left empty is treated as satisfied (not applied) — so setting only Field 1/Value 1 filters by that single condition, and leaving both pairs empty keeps every element. With OR, an element is kept if either condition holds; with AND (the default), both must hold.


Is Array Empty .json

Checks whether a named list is empty (or missing) and saves a yes/no answer.

When to use it: to let a later step react to there being no data — for example skip a report when the results list came back empty.

Parameter Meaning Default Required
Document key The loaded document to query. Empty = current document (accepts @name) (empty) No
Array field name The field holding the list to check (accepts @name) items No
Save result key Saves the yes/no answer (empty or not) under this name (empty) No

Important behavior: the answer is yes (empty) not only when the list has no elements, but also when the document isn’t an object, doesn’t contain that field, or the field isn’t a list. Only a present list with at least one element gives no (not empty). If no document is loaded, nothing happens and nothing is saved.


Query With JSONPath .json

Selects values from anywhere in the document using a JSONPath expression and saves all the matches as a list.

When to use it: to reach into nested data with a single expression — for example collect every book title with $.store.books[*].title, rather than stepping in field by field.

Parameter Meaning Default Required
Document key The loaded document to query. Empty = current document (accepts @name) (empty) No
JSONPath The JSONPath expression to select with, e.g. $.store.books[*].title (accepts @name) $.* No
Save key Saves the list of matched values under this name (empty) No

Important behavior: works on any document (object or list), not just a named list. Every value the expression matches is collected into a list and saved under Save key; if the expression matches nothing, an empty list is saved. If no document is loaded or the JSONPath is blank, nothing happens.


This documentation is the help of the application, and it comes underCreative Commons Attribution 4.0.