JSON Diff Tool
JSON Diff tool allows Portal administrators to compare two JSON or text files when upgrading products or continuous deployment and delivery of features in customers' environments. The JSON Diff tool efficiently compares two JSON files and merge the differences into one file and then deploys or extracts changes. This helps not to override existing configuration when there are modifications to existing records, the addition of new records, or the deletion of old records.
To allow the JSON Diff tool to work for actors and widgets, the Visualfroce page domain needs to add under the trusted domain for inline frames in the Salesforce org settings. For more information, see Add Trusted Domains for Inline Frames.
Features
Compare two JSON files.
View newly added records.
View existing records that were deleted.
View all the changes and the location where these changes were made.
Specify which fields/attributes to skip for comparison in the JSON. For example, "Id" attribute does not need to be compared.
Specify which fields/attributes to use to order arrays for comparison.
Specify which fields/attributes would need to be deserialized further for an effective comparison. For example, the navigation structure JSON is captured as a serialized string in clcommon__data__c field. And to show the correct difference, this field should be first converted to JSON and then compared.
Steps
In the JSON DIFFS tool, click Choose File to upload the first JSON or Text file for comparison.
Click Choose File to upload the second JSON or Text file for comparison.
To initiate the comparison, click Diff Files.
The first uploaded file is displayed in the left section and the other one is displayed in the right section. The differences are highlighted in both files in the following colors:
Green - A property on the right exists that isn't on the left side. This shows the addition of the property.
Red - A property on the left exists that isn't on the right side. This shows the deletion of the property.
Yellow: The property exists on both sides, but the contents are different. This shows the modification of the property.
You can edit any of the files and make the changes according to your need. To do so, click the Edit icon.
To navigate to the next change, use the up or down arrow keys.
To merge changes, press the left or right arrow keys. To bring the changes from left to right, press the right arrow key. To bring changes from right to left, press the left arrow key.
The merged change will be marked in blue color to show that it was recently merged.
Note:You cannot undo the merged changes. However, the changes are not saved in the original file. If you want to undo the changes you made, click Rerun Diff, and make all the required changes again.
After the changes are done, use the Export Left or Export Right buttons to export the file with the final changes.
Status
Release Available | Status | Framework Name |
---|---|---|
3.8 | Current | TBC |
Implementation Details
All project files can currently be viewed on Github: https://github.com/cloudlending/CL-Portal/tree/json-diff-tool/src/json-diff-tool
This project takes in two .txt or .json files as input, converts them into javascript objects, and then runs a recursive comparison function to return all differences between the two files.