json-keyvalue-extractor
Reactive icon

JSON → KeyValue Extractor

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 27 Jan (9 hours ago)
 by 
EONE TECHNOLOGIES PRIVATE LIMITED
0.0
 (0 ratings)
json-keyvalue-extractor

JSON → KeyValue Extractor

Documentation
1.0.0

Key Features

  1. Flatten Nested JSON

    • Converts deeply nested objects into a single-level list of key-value pairs.

    • Supports dot notation (parent.child.key) and array indexing (array[0]) for precise mapping.

  2. Array Handling

    • Processes arrays seamlessly, creating keys that represent the index of each element.

    • Nested arrays and objects are recursively flattened.

  3. Base64 Binary Detection

    • Automatically detects string values that are Base64-encoded, flagging them as binary.

    • Useful for safely handling file attachments, images, or encoded payloads.

  4. Dynamic and Type-Safe

    • Works with unknown or dynamic JSON structures.

    • Preserves data types for primitives: string, number, boolean, null.

  5. Developer-Friendly

    • Lightweight and efficient JavaScript implementation.

    • Provides a clean, reusable pattern for any JSON manipulation scenario.


Input:

{

  "id": 123,

  "owner": {

    "firstName": "John",

    "lastName": "Doe"

  },

  "attachments": [

    { "fileName": "invoice.pdf", "contentBase64": "JVBERi0xLjMK..." }

  ]

}

Output:

[

  { "Key": "id", "Value": 123 },

  { "Key": "owner.firstName", "Value": "John" },

  { "Key": "owner.lastName", "Value": "Doe" },

  { "Key": "attachments[0].fileName", "Value": "invoice.pdf" },

  { "Key": "attachments[0].contentBase64", "Value": "JVBERi0xLjMK...", "IsBinary": true }

]