Skip to content
Stand with Ukraine flag

Check Fields Presence

Use this node to guard downstream processing against messages that are missing required fields. For example, before saving attributes you can verify that both firmware_version and serial_number are present in the payload, or that a token metadata key exists before making an authenticated API call.

  • Message field names — optional. A set of top-level JSON field names to check in the message data.
  • Metadata field names — optional. A set of metadata key names to check in the message metadata.

At least one of the two lists must contain at least one entry.

  • Check that all specified fields are present — toggle (default: enabled).
    • Enabled: route True only if all listed fields are present in both data and metadata.
    • Disabled: route True if at least one listed field exists anywhere in data or metadata.
  1. Extract message data as a JSON object and metadata as key–value pairs.
  2. Evaluate presence based on the toggle:
    • All fields required: route True if every field in messageNames exists in data and every field in metadataNames exists in metadata.
    • Any field sufficient: route True if any listed field exists in data or metadata.
  3. If the condition is not satisfied, route False.
  4. If the payload is not a JSON object or another error occurs, route Failure.
ConnectionCondition
TrueThe configured presence condition is satisfied.
FalseThe configured presence condition is not satisfied.
FailureThe message data cannot be parsed as a JSON object, or an unexpected error occurred.

Example 1 — All required data fields present → True

Section titled “Example 1 — All required data fields present → True”
{
"messageNames": ["temp", "humidity"],
"metadataNames": [],
"checkAllKeys": true
}

Incoming data: { "temp": 22.5, "humidity": 55 }

Result: True — both temp and humidity exist.


Example 2 — Missing one required field → False

Section titled “Example 2 — Missing one required field → False”
{
"messageNames": ["temp", "humidity"],
"metadataNames": [],
"checkAllKeys": true
}

Incoming data: { "temp": 22.5 }

Result: Falsehumidity is absent.


Example 3 — At least one metadata field → True

Section titled “Example 3 — At least one metadata field → True”
{
"messageNames": [],
"metadataNames": ["token", "tenantId"],
"checkAllKeys": false
}

Incoming metadata: { "deviceName": "Pump-42", "token": "abc123" }

Result: Truetoken is present.


Example 4 — Mixed check, data field present → True

Section titled “Example 4 — Mixed check, data field present → True”
{
"messageNames": ["temperature"],
"metadataNames": ["token", "tenantId"],
"checkAllKeys": false
}

Incoming data: { "temperature": 123, "humidity": 42 } Incoming metadata: { "deviceName": "Sensor-1" }

Result: Truetemperature is found in data.


Example 5 — Non-object payload → Failure

Section titled “Example 5 — Non-object payload → Failure”
{
"messageNames": ["temp"],
"metadataNames": [],
"checkAllKeys": true
}

Incoming data: "not a JSON object"

Result: Failure — data cannot be parsed as a JSON object.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "TbCheckMessageNodeConfiguration",
"type": "object",
"additionalProperties": false,
"properties": {
"messageNames": {
"description": "Field names to check in the message data.",
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"metadataNames": {
"description": "Field names to check in the message metadata.",
"type": "array",
"items": { "type": "string", "minLength": 1 },
"uniqueItems": true
},
"checkAllKeys": {
"description": "If true, require all listed fields. If false, require at least one.",
"type": "boolean",
"default": true
}
},
"anyOf": [
{ "properties": { "messageNames": { "minItems": 1 } } },
{ "properties": { "metadataNames": { "minItems": 1 } } }
]
}