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.
leftJsonIn
rightJsonIn (string) – JSON array of new items.
rightJsonIn
keyFieldIn (string) – Unique key field to match objects.
keyFieldIn
ReturnUnchangedIn (bool) – If true, returns unchanged items.
ReturnUnchangedIn
true
IgnoreChangedFieldsIn (string) – Comma-separated list of fields to ignore.
IgnoreChangedFieldsIn
ReplaceFieldMatrixIn (string) – JSON array of {From, To} objects to rename fields.
ReplaceFieldMatrixIn
{From, To}
HumanizeFieldsIn (bool) – If true, camelCase or PascalCase fields not in replace matrix are converted to human-readable names.
HumanizeFieldsIn
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"}} ]