How is your experience with the OutSystems Community?
JsonComparator

JsonComparator (ODC)

Stable version 0.1.1 (Compatible with ODC)
Uploaded on 12 August 2025 by Experieco Limited
JsonComparator

JsonComparator (ODC)

Documentation
0.1.1

JsonComparator is a small utility class that compares two JSON objects (as strings) and returns structured differences. Ideal for building human-friendly or machine-readable logs when objects change.

Common uses:

  • Support / Audit logs
    Record what fields changed and their before/after values.

  • Change notifications
    Include the HTML render ready description in email or UI notifications to show what changed.

  • Webhook payload comparison
    Verify delta between old and new payloads for idempotency checks.

  • Regression / integration tests
    Detect unexpected changes in API responses or config objects.




Simple step-by-step how to use and configure.
1. Add JsonComparator public elements to your app

2. Feed it two JSON strings (PrevJson = Original value of the JSON, NewJson = Changed value of the JSON)
GetJsonDifferences sample usage

GetJsonDifferences result in a list widget




GetOperationDetails sample usage


GetOperationDetails result rendered using HTMLinject



What to expect

  • If a field is added: OriginalValue = "", NewValue = "value".

  • If a field is removed: OriginalValue = "value", NewValue = "".

  • If a field changed: OriginalValue = "old", NewValue = "new".

  • Property name matching is case-insensitive (Name == name).

  • Arrays are compared element-by-element (order matters).

  • Nested objects/arrays: OriginalValue / NewValue will contain the raw JSON text for that value.