Skip to main content
The Recursive JSON With Parent command (Command Type: 1006) extracts deeply nested child elements while preserving their parent-child hierarchy. It traverses the structure up a configurable number of levels to include ancestor context.

Overview

The Recursive JSON With Parent command provides functionality for:
  • Recursively traversing nested JSON structures
  • Preserving parent context at a configurable number of levels
  • Identifying child elements by a specified property key

Command Type

Command Type ID: 1006

Parameters

ParameterTypeDescriptionRequired
propertystringThe property key in the JSON object used to identify child elementsYes
parentLevelnumberDetermines how many levels up the hierarchy to include in the returned structureYes

Usage Examples

Extract Children with One Parent Level

{
  "command": "recursive-json-with-parent",
  "params": {
    "property": "children",
    "parentLevel": 1
  }
}

Extract with Two Parent Levels

{
  "command": "recursive-json-with-parent",
  "params": {
    "property": "items",
    "parentLevel": 2
  }
}

Traverse Nested Categories

{
  "command": "recursive-json-with-parent",
  "params": {
    "property": "subcategories",
    "parentLevel": 1
  }
}

Common Use Cases

  • Tree Traversal: Flatten recursive tree structures (e.g. categories, menus, org charts)
  • Hierarchy Extraction: Pull leaf nodes out of deep nesting while retaining parent context
  • Data Normalization: Convert nested recursive JSON into flat records with ancestry