json-key-change-detector
Service icon

JSON Key Change Detector

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 12 Feb (10 hours ago)
 by 
0.0
 (0 ratings)
json-key-change-detector

JSON Key Change Detector

Documentation
1.0.0

📘 JSON Key Change Detector — Documentation

🔍 Overview

JSON Key Change Detector is an OutSystems Integration Studio extension (C#) that compares two JSON payloads and detects key-level differences.

It returns:

  • Added Keys → keys present in the new JSON but not in the old JSON

  • Removed Keys → keys present in the old JSON but not in the new JSON

  • Common Keys → keys present in both JSON payloads

Nested keys are supported and returned using dot notation, for example:

  • owner.name

  • vehicle.status.id

This component compares only the keys, not the values.


✅ Installation

1) Install the Extension

  1. Download the asset from OutSystems Forge.

2) Use in Your Application

  1. Open your OutSystems module in Service Studio

  2. Go to Manage Dependencies

  3. Add the extension

  4. Use the action in your logic


⚙️ Available Action


CompareJsonKeys

Compares an old JSON and a new JSON and returns key differences.


📥 Input Parameters

OldJson (Text)

The original JSON string (baseline).

Example:

{"owner":{"name":"Murali","dob":"1999-01-01"}}

NewJson (Text)

The updated JSON string.

Example:

{"owner":{"name":"Murali","city":"Chennai"},"vehicle":{"status":"Active"}}

📤 Output Parameters

AddedKeys (Text)

JSON array string of keys present only in the New JSON.

Example:

["owner.city","vehicle","vehicle.status"]

RemovedKeys (Text)

JSON array string of keys present only in the Old JSON.

Example:

["owner.dob"]

CommonKeys (Text)

JSON array string of keys present in both.

Example:

["owner","owner.name"]

🧪 Example Usage in OutSystems

  1. Create a screen with:

    • Input TextArea for Old JSON

    • Input TextArea for New JSON

    • Button: Compare

  2. On button click:

    • Call CompareJsonKeys(OldJson, NewJson)

    • Display the returned AddedKeys / RemovedKeys / CommonKeys


📌 Notes & Behavior

  • Works with nested objects and arrays.

  • Array indexes are not included (items[0], items[1] are ignored).

  • Only keys are compared, not values.

  • Output is returned as JSON array string for easy parsing/display.


⚠️ Limitations

  • Invalid JSON input will return empty key lists.

  • Large JSON payloads may take longer depending on server resources.


🛠️ Support

If you face issues or want enhancements (like leaf-keys-only mode), please raise a discussion in the Forge asset page.