Skip to content
Stand with Ukraine flag

JSON Path

Use this node to extract a portion of the message data using a JSONPath expression and replace the entire message data with the result — for example, pulling just the telemetry sub-object from a deeply nested payload, or filtering an array of sensor readings to only those matching a condition.

  • JSONPath — required. The JSONPath expression to apply to the incoming message data. The expression result becomes the new message data. Default value $ selects the entire document (pass-through).
  1. Apply the configured JSONPath expression to the incoming message data.
  2. If the message data is not valid JSON, route via Failure.
  3. If the expression matches one or more elements, replace the message data with the query result and route via Success.
  4. If the expression finds no match (path not found), route via Failure.
ConnectionCondition
SuccessJSONPath expression evaluated successfully; message data replaced with result.
FailureMessage data is not valid JSON, path not found, or an unexpected error occurred.

Incoming data: { "device": { "name": "Thermostat A1" }, "telemetry": { "temperature": 23.5, "humidity": 55 } }

{ "jsonPath": "$.telemetry" }

Outgoing data: { "temperature": 23.5, "humidity": 55 } — the telemetry sub-object becomes the new payload.


Incoming data: { "device_profiles": [{ "name": "default", "isDefault": true }, { "name": "low_power", "isDefault": false }] }

{ "jsonPath": "$.device_profiles[1].name" }

Outgoing data: "low_power" — scalar string becomes the new message data.


Incoming data: { "temperature": 25.1 }

{ "jsonPath": "$.humidity" }

Result: humidity does not exist — routes via Failure.


Incoming data: { "readings": [{ "type": "temperature", "value": 19 }, { "type": "humidity", "value": 78 }, { "type": "temperature", "value": 21 }] }

{ "jsonPath": "$.readings[?(@.type == 'temperature')]" }

Outgoing data: [{ "type": "temperature", "value": 19 }, { "type": "temperature", "value": 21 }] — array filtered to temperature readings only.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "TbJsonPathNodeConfiguration",
"type": "object",
"required": ["jsonPath"],
"additionalProperties": false,
"properties": {
"jsonPath": {
"type": "string",
"description": "JSONPath expression to apply to the message data."
}
}
}