JQ
JQ is a lightweight processing language for manipulation of JSON
objects. It is often used to look up specific nodes
from a payload, but can also be used to transform the data.
The Unmeshed JQ engine is compatible with JQ version 1.6.
Video Overview
Input
Field | Description | Mandatory | JSON Example |
---|---|---|---|
input | The JSON data to manipulate. | ✔ | { "version": 12 } |
script | The JQ expression to run against the provided input. | ✔ | ".version" |
Output
Field | Description |
---|---|
result | A JSON object containing the processed input. |
Example
Here's an example that uses JQ syntax to get all the nationalities of best-selling authors published after 2019.
- Input
- Script
- Result
{
"bestsellers": [
{
"title": "Where the Crawdads Sing",
"author": {
"name": "Delia Owens",
"nationality": "American"
},
"published_year": 2018,
},
{
"title": "The Midnight Library",
"author": {
"name": "Matt Haig",
"nationality": "British"
},
"published_year": 2020,
}
]
}
.bestsellers[] | select(.published_year > 2019) | .author.nationality
[ "British" ]
tip
To use another Step's output as the input for the JQ Step, use the following template syntax:
{{ steps.your_steps_ref.output.fieldName }}