Login to follow
DiffJSONLists

DiffJSONLists (ODC)

Stable version 0.1.1 (Compatible with ODC)
Uploaded on 16 Jan by Noesis
DiffJSONLists

DiffJSONLists (ODC)

Documentation
0.1.1

JSON Diff Lists Extension

Compares two JSON arrays and returns the differences. Detects Added, Removed, Changed, and optionally Unchanged items. Supports ignoring fields, renaming fields, and humanizing field names.

Parameters:

  • leftJsonIn (string) – JSON array of original items.

  • rightJsonIn (string) – JSON array of new items.

  • keyFieldIn (string) – Unique key field to match objects.

  • ReturnUnchangedIn (bool) – If true, returns unchanged items.

  • IgnoreChangedFieldsIn (string) – Comma-separated list of fields to ignore.

  • ReplaceFieldMatrixIn (string) – JSON array of {From, To} objects to rename fields.

  • HumanizeFieldsIn (bool) – If true, camelCase or PascalCase fields not in replace matrix are converted to human-readable names.

Example:

JSON_DiffLists( leftJson, rightJson, "Id", true, "lastName", '[{"From":"firstName","To":"First Name"}]', true )

Output:

[ {"Type":"Unchanged","Key":1}, {"Type":"Changed","Key":2,"Changes":[{"Field":"Last Name","OldValue":"Smith","NewValue":"Johnson"}]}, {"Type":"Added","Key":3,"NewValue":{"Id":3,"firstName":"Bob","lastName":"Brown"}} ]