How to compare two Json file and write into text file

HI, Am having two file (Source and target) in json format and i need to compare both the files and write in an separate text file. both file may have nested json string. Output should should return the difference not just assertion. Kindly help me on this ASAP.

Hi @sowmiyas ,

One way of doing it is to have the automation use a simple free online comparator to copy-paste the two jsons and then extract the differences. Here is a quick sample:

The challenge may be to extract the contents of the lines where the differences are. In this case Line 2 has a different selector. Depending on the comparison you want to run, you may be able to use a generic expression for the left-window and the right-window to extract the differences from both windows, or just one of the two windows.

This particular free site has a feature to email comparisons which is a roundabout way of getting the information if your situation allows you to signup on this site.

@AndyMenon thanks for the reply. i already saw these kind of online tools. but am looking for possible way using uipath activities. not an online comparator.

My two cents,

UiPath helps you to automate what you would otherwise do manually or by some other means. It isn’t absolutely necessary that the UiPath stack contain everything out of the box such as a comparator feature you are looking for.

That said, if there is enough justification to add a comparison feature , then future updates may include them.

Thanks