# Json compare tool for Views and Tags?

**URL:** <https://forum.inductiveautomation.com/t/json-compare-tool-for-views-and-tags/41163>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [December 3, 2020, 4:56am UTC](https://forum.inductiveautomation.com/t/json-compare-tool-for-views-and-tags/41163 "2020-12-03T04:56:30Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [October 31, 2024, 2:48pm UTC](https://forum.inductiveautomation.com/t/json-compare-tool-for-views-and-tags/41163/15 "2024-10-31T14:48:42Z")

</div>

Here's a link to another post showing the method I use (that thread has a few more elegant options to suit their needs as well):

> [@Json Diffing Discussion](https://forum.inductiveautomation.com/t/json-diffing-discussion/96800/35):
>
> My implementation of a dictionary & list deepSort() recursive function: \*Edit: Keys within dictionaries (and values within lists) are not 'sorted' (alphabetically & numerically ascending) but does appear to organize keys/values of two UDTs in the same order. Hmmm.... def deepSort(obj, ignoreKeys=[]): # Beta if isinstance(obj, list): result = [] for value in sorted(obj): if hasattr(value, '\_\_iter\_\_'): result.append(deepSort(value)) else: result.append(value) return result …

My procedure is as follows:

- From Script Console:
  - Get tag configs (see code from thread above)
  - Sort tag configs (see code from thread above)
  - Copy output of both configs (see code from thread above) to Notepad++, with each config in a different file/tab.

- For each file, within Notepad++:
  - Using _JSTool_ Add-on: JSFormat (Pretty-print JSON - even if it's not valid JSON)
  - Change Language back to None (from Language menu - basically, ignore all of the errors that the JSON interpreter throws)

- Then, using _Compare_ Add-on:
  - While File 1 is active, select "Set as First to Compare".
  - While File 2 is active, select "Compare".

A sample output is also in that thread, except, the comparison was not from a `system.tag.getConfiguration()` output.

That deepSort() function could probably be enhanced to utilize an OrderedDict, but has suited my needs so far.

---

_[View the full topic](https://forum.inductiveautomation.com/t/json-compare-tool-for-views-and-tags/41163)._
