dynamic-json-parser
Reactive icon

Dynamic JSON Parser

Stable version 2.0.0 (Compatible with OutSystems 11)
Uploaded
 on 2 Feb (8 hours ago)
 by 
0.0
 (0 ratings)
dynamic-json-parser

Dynamic JSON Parser

Documentation
2.0.0

1. Overview

The Dynamic JSON Parser Forge component provides a utility for flattening complex JSON structures into a tabular-like format for easy processing in OutSystems Reactive applications. This component is especially useful for:

  • Parsing deeply nested JSON objects and arrays.
  • Capturing the full hierarchy of JSON keys, values, and metadata.
  • Preparing JSON data for display, reporting, or integration with structured OutSystems entities.

The component supports a wide range of JSON types, including arrays, objects, primitive values, and handles empty or null fields.


2. Input Parameters

Parameter NameTypeRequiredDescription
JsonTextTextYesThe JSON string to be flattened. Can include nested objects, arrays, primitives, or combinations.


3. Output Parameters

Parameter NameTypeDescription
FlattenedJsonTextTextA JSON string representing the flattened output with all metadata fields.
IsValidJsonBooleanIndicates if the input JSON is valid (true) or invalid (false).


4. Output JSON Structure

Each record in the flattened output contains the following fields:

FieldTypeDescription
keyTextThe key name of the JSON attribute.
valueText / Number / Boolean / [nested] / [nested-blank] / [blank]The actual value of the attribute. [nested] for non-empty objects/arrays, [nested-blank] for empty objects/arrays, [blank] for null or empty strings.
pathValueTextThe hierarchical path to the attribute, including array indices, e.g., records[0].items[1].value.
typeTextThe data type: text, integer, decimal, boolean, date, datetime, time, array, object, or empty for blank values.
parentTextThe key of the immediate parent object. Blank if root.
levelIntegerDepth level in the JSON hierarchy (0 = root, 1 = first-level child, etc.).
parentIndexIntegerIndex of the parent in its array if parent is an array; 0 otherwise.
childIndexIntegerIndex of this element if it belongs to an array; 0 otherwise.


5. Supported JSON Data Types

  • Primitive types:
    • String → text
    • Integer → integer
    • Decimal → decimal
    • Boolean → boolean
    • Null / empty string → [blank]
  • Date/Time types (string format):
    • ISO Date (YYYY-MM-DD) → date
    • ISO DateTime (YYYY-MM-DDTHH:MM:SSZ) → datetime
    • Time (HH:MM:SS) → time
  • Compound types:
    • Object → object
    • Array → array
    • Empty array or object → [nested-blank]

6. JSON Flattening Rules

  • Primitive Values: Directly stored with key, value, type. pathValue tracks the full hierarchical path.
  • Objects: Non-empty → value = [nested], type = object. Empty → value = [nested-blank], type blank.
  • Arrays: Non-empty → value = [nested], type = array. Empty → value = [nested-blank], type blank. Array elements include indices in pathValue (e.g., arrayName[0]).
  • Hierarchy Metadata: level increments for each nesting. parent references immediate parent key. parentIndex tracks array index of parent if applicable. childIndex tracks array index of current element if applicable.
  • Blank Values: Null or empty strings → value = [blank], type = "".

7. Example Input JSON

{
  "stringValue": "Hello World",
  "integerValue": 123,
  "decimalValue": 123.45,
  "booleanValueTrue": true,
  "booleanValueFalse": false,
  "nullValue": null,
  "dateValue": "2025-11-21",
  "datetimeValue": "2025-11-21T13:30:00Z",
  "timeValue": "14:30:00",
  "emptyString": "",
  "nestedObject": {
    "street": "123 Main St",
    "city": "Makati",
    "zip": "12345",
    "emptyObject": {},
    "emptyArray": []
  },
  "arrayOfPrimitives": ["item1","item2","item3"],
  "arrayOfObjects": [
    {"key1":"value1","key2":10},
    {"key1":"value2","key2":20}
  ],
  "nestedArrayObjects": [
    {
      "records": [
        {
          "records": [
            {"value":"value 1"},
            {"value":"value 2"}
          ]
        }
      ]
    }
  ]
}


8. Example Output JSON

[
  {"key":"stringValue","value":"Hello World","pathValue":"stringValue","type":"text","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"integerValue","value":123,"pathValue":"integerValue","type":"integer","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"decimalValue","value":123.45,"pathValue":"decimalValue","type":"decimal","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"booleanValueTrue","value":true,"pathValue":"booleanValueTrue","type":"boolean","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"booleanValueFalse","value":false,"pathValue":"booleanValueFalse","type":"boolean","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"nullValue","value":"[blank]","pathValue":"nullValue","type":"","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"dateValue","value":"2025-11-21","pathValue":"dateValue","type":"date","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"datetimeValue","value":"2025-11-21T13:30:00Z","pathValue":"datetimeValue","type":"datetime","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"timeValue","value":"14:30:00","pathValue":"timeValue","type":"time","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"emptyString","value":"[blank]","pathValue":"emptyString","type":"","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"nestedObject","value":"[nested]","pathValue":"nestedObject","type":"object","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"street","value":"123 Main St","pathValue":"nestedObject.street","type":"text","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"city","value":"Makati","pathValue":"nestedObject.city","type":"text","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"zip","value":"12345","pathValue":"nestedObject.zip","type":"text","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"emptyObject","value":"[nested-blank]","pathValue":"nestedObject.emptyObject","type":"","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"emptyArray","value":"[nested-blank]","pathValue":"nestedObject.emptyArray","type":"","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"arrayOfPrimitives","value":"[nested]","pathValue":"arrayOfPrimitives","type":"array","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"arrayOfPrimitives","value":"item1","pathValue":"arrayOfPrimitives[0]","type":"text","parent":"arrayOfPrimitives","level":1,"parentIndex":0,"childIndex":0},
  {"key":"arrayOfPrimitives","value":"item2","pathValue":"arrayOfPrimitives[1]","type":"text","parent":"arrayOfPrimitives","level":1,"parentIndex":0,"childIndex":1},
  {"key":"arrayOfPrimitives","value":"item3","pathValue":"arrayOfPrimitives[2]","type":"text","parent":"arrayOfPrimitives","level":1,"parentIndex":0,"childIndex":2},
  {"key":"arrayOfObjects","value":"[nested]","pathValue":"arrayOfObjects","type":"array","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"key1","value":"value1","pathValue":"arrayOfObjects[0].key1","type":"text","parent":"arrayOfObjects","level":1,"parentIndex":0,"childIndex":0},
  {"key":"key2","value":10,"pathValue":"arrayOfObjects[0].key2","type":"integer","parent":"arrayOfObjects","level":1,"parentIndex":0,"childIndex":0},
  {"key":"key1","value":"value2","pathValue":"arrayOfObjects[1].key1","type":"text","parent":"arrayOfObjects","level":1,"parentIndex":1,"childIndex":0},
  {"key":"key2","value":20,"pathValue":"arrayOfObjects[1].key2","type":"integer","parent":"arrayOfObjects","level":1,"parentIndex":1,"childIndex":0},
  {"key":"nestedArrayObjects","value":"[nested]","pathValue":"nestedArrayObjects","type":"array","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"records","value":"[nested]","pathValue":"nestedArrayObjects[0].records","type":"array","parent":"nestedArrayObjects","level":1,"parentIndex":0,"childIndex":0},
  {"key":"records","value":"[nested]","pathValue":"nestedArrayObjects[0].records[0].records","type":"array","parent":"records","level":2,"parentIndex":0,"childIndex":0},
  {"key":"value","value":"value 1","pathValue":"nestedArrayObjects[0].records[0].records[0].value","type":"text","parent":"records","level":3,"parentIndex":0,"childIndex":0},
  {"key":"value","value":"value 2","pathValue":"nestedArrayObjects[0].records[0].records[1].value","type":"text","parent":"records","level":3,"parentIndex":0,"childIndex":1}
]


9. Recommended Usage

  • Input: Provide a valid JSON string in the JsonText input parameter.
  • Call: Use this component in Reactive screens or server actions.
  • Output: Parse FlattenedJsonText into an OutSystems Record List for table display or further processing.

10. Notes

  • Invalid JSON strings are automatically detected. FlattenedJsonText will contain: [{"error":"Invalid JSON"}]
  • Arrays and objects are recursively traversed to any depth.
  • The component is optimized for clarity in hierarchy using pathValue,

1.0.0

1. Overview

The Dynamic JSON Parser Forge component provides a utility for flattening complex JSON structures into a tabular-like format for easy processing in OutSystems Reactive applications. This component is especially useful for:

  • Parsing deeply nested JSON objects and arrays.
  • Capturing the full hierarchy of JSON keys, values, and metadata.
  • Preparing JSON data for display, reporting, or integration with structured OutSystems entities.

The component supports a wide range of JSON types, including arrays, objects, primitive values, and handles empty or null fields.


2. Input Parameters

Parameter NameTypeRequiredDescription
JsonTextTextYesThe JSON string to be flattened. Can include nested objects, arrays, primitives, or combinations.


3. Output Parameters

Parameter NameTypeDescription
FlattenedJsonTextTextA JSON string representing the flattened output with all metadata fields.
IsValidJsonBooleanIndicates if the input JSON is valid (true) or invalid (false).


4. Output JSON Structure

Each record in the flattened output contains the following fields:

FieldTypeDescription
keyTextThe key name of the JSON attribute.
valueText / Number / Boolean / [nested] / [nested-blank] / [blank]The actual value of the attribute. [nested] for non-empty objects/arrays, [nested-blank] for empty objects/arrays, [blank] for null or empty strings.
pathValueTextThe hierarchical path to the attribute, including array indices, e.g., records[0].items[1].value.
typeTextThe data type: text, integer, decimal, boolean, date, datetime, time, array, object, or empty for blank values.
parentTextThe key of the immediate parent object. Blank if root.
levelIntegerDepth level in the JSON hierarchy (0 = root, 1 = first-level child, etc.).
parentIndexIntegerIndex of the parent in its array if parent is an array; 0 otherwise.
childIndexIntegerIndex of this element if it belongs to an array; 0 otherwise.


5. Supported JSON Data Types

  • Primitive types:
    • String → text
    • Integer → integer
    • Decimal → decimal
    • Boolean → boolean
    • Null / empty string → [blank]
  • Date/Time types (string format):
    • ISO Date (YYYY-MM-DD) → date
    • ISO DateTime (YYYY-MM-DDTHH:MM:SSZ) → datetime
    • Time (HH:MM:SS) → time
  • Compound types:
    • Object → object
    • Array → array
    • Empty array or object → [nested-blank]

6. JSON Flattening Rules

  • Primitive Values: Directly stored with key, value, type. pathValue tracks the full hierarchical path.
  • Objects: Non-empty → value = [nested], type = object. Empty → value = [nested-blank], type blank.
  • Arrays: Non-empty → value = [nested], type = array. Empty → value = [nested-blank], type blank. Array elements include indices in pathValue (e.g., arrayName[0]).
  • Hierarchy Metadata: level increments for each nesting. parent references immediate parent key. parentIndex tracks array index of parent if applicable. childIndex tracks array index of current element if applicable.
  • Blank Values: Null or empty strings → value = [blank], type = "".

7. Example Input JSON

{
  "stringValue": "Hello World",
  "integerValue": 123,
  "decimalValue": 123.45,
  "booleanValueTrue": true,
  "booleanValueFalse": false,
  "nullValue": null,
  "dateValue": "2025-11-21",
  "datetimeValue": "2025-11-21T13:30:00Z",
  "timeValue": "14:30:00",
  "emptyString": "",
  "nestedObject": {
    "street": "123 Main St",
    "city": "Makati",
    "zip": "12345",
    "emptyObject": {},
    "emptyArray": []
  },
  "arrayOfPrimitives": ["item1","item2","item3"],
  "arrayOfObjects": [
    {"key1":"value1","key2":10},
    {"key1":"value2","key2":20}
  ],
  "nestedArrayObjects": [
    {
      "records": [
        {
          "records": [
            {"value":"value 1"},
            {"value":"value 2"}
          ]
        }
      ]
    }
  ]
}


8. Example Output JSON

[
  {"key":"stringValue","value":"Hello World","pathValue":"stringValue","type":"text","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"integerValue","value":123,"pathValue":"integerValue","type":"integer","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"decimalValue","value":123.45,"pathValue":"decimalValue","type":"decimal","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"booleanValueTrue","value":true,"pathValue":"booleanValueTrue","type":"boolean","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"booleanValueFalse","value":false,"pathValue":"booleanValueFalse","type":"boolean","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"nullValue","value":"[blank]","pathValue":"nullValue","type":"","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"dateValue","value":"2025-11-21","pathValue":"dateValue","type":"date","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"datetimeValue","value":"2025-11-21T13:30:00Z","pathValue":"datetimeValue","type":"datetime","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"timeValue","value":"14:30:00","pathValue":"timeValue","type":"time","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"emptyString","value":"[blank]","pathValue":"emptyString","type":"","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"nestedObject","value":"[nested]","pathValue":"nestedObject","type":"object","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"street","value":"123 Main St","pathValue":"nestedObject.street","type":"text","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"city","value":"Makati","pathValue":"nestedObject.city","type":"text","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"zip","value":"12345","pathValue":"nestedObject.zip","type":"text","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"emptyObject","value":"[nested-blank]","pathValue":"nestedObject.emptyObject","type":"","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"emptyArray","value":"[nested-blank]","pathValue":"nestedObject.emptyArray","type":"","parent":"nestedObject","level":1,"parentIndex":0,"childIndex":0},
  {"key":"arrayOfPrimitives","value":"[nested]","pathValue":"arrayOfPrimitives","type":"array","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"arrayOfPrimitives","value":"item1","pathValue":"arrayOfPrimitives[0]","type":"text","parent":"arrayOfPrimitives","level":1,"parentIndex":0,"childIndex":0},
  {"key":"arrayOfPrimitives","value":"item2","pathValue":"arrayOfPrimitives[1]","type":"text","parent":"arrayOfPrimitives","level":1,"parentIndex":0,"childIndex":1},
  {"key":"arrayOfPrimitives","value":"item3","pathValue":"arrayOfPrimitives[2]","type":"text","parent":"arrayOfPrimitives","level":1,"parentIndex":0,"childIndex":2},
  {"key":"arrayOfObjects","value":"[nested]","pathValue":"arrayOfObjects","type":"array","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"key1","value":"value1","pathValue":"arrayOfObjects[0].key1","type":"text","parent":"arrayOfObjects","level":1,"parentIndex":0,"childIndex":0},
  {"key":"key2","value":10,"pathValue":"arrayOfObjects[0].key2","type":"integer","parent":"arrayOfObjects","level":1,"parentIndex":0,"childIndex":0},
  {"key":"key1","value":"value2","pathValue":"arrayOfObjects[1].key1","type":"text","parent":"arrayOfObjects","level":1,"parentIndex":1,"childIndex":0},
  {"key":"key2","value":20,"pathValue":"arrayOfObjects[1].key2","type":"integer","parent":"arrayOfObjects","level":1,"parentIndex":1,"childIndex":0},
  {"key":"nestedArrayObjects","value":"[nested]","pathValue":"nestedArrayObjects","type":"array","parent":"","level":0,"parentIndex":0,"childIndex":0},
  {"key":"records","value":"[nested]","pathValue":"nestedArrayObjects[0].records","type":"array","parent":"nestedArrayObjects","level":1,"parentIndex":0,"childIndex":0},
  {"key":"records","value":"[nested]","pathValue":"nestedArrayObjects[0].records[0].records","type":"array","parent":"records","level":2,"parentIndex":0,"childIndex":0},
  {"key":"value","value":"value 1","pathValue":"nestedArrayObjects[0].records[0].records[0].value","type":"text","parent":"records","level":3,"parentIndex":0,"childIndex":0},
  {"key":"value","value":"value 2","pathValue":"nestedArrayObjects[0].records[0].records[1].value","type":"text","parent":"records","level":3,"parentIndex":0,"childIndex":1}
]


9. Recommended Usage

  • Input: Provide a valid JSON string in the JsonText input parameter.
  • Call: Use this component in Reactive screens or server actions.
  • Output: Parse FlattenedJsonText into an OutSystems Record List for table display or further processing.

10. Notes

  • Invalid JSON strings are automatically detected. FlattenedJsonText will contain: [{"error":"Invalid JSON"}]
  • Arrays and objects are recursively traversed to any depth.
  • The component is optimized for clarity in hierarchy using pathValue,