Compare Two JSON Files Function: jsonCompare
The Compare Two JSON Files function is used to compare two JSON objects to determine if they are identical. You can either provide JSON values directly or reference variables storing JSON data for comparison. This function is useful for validating API responses, ensuring data consistency, or performing structured data verification.
Example Usage:
- Example 1: Comparing Two JSON Objects Directly: Validating if the following two JSON responses from an API match expected results.
Steps to Configure:
- Select Set a Variable Value from the Action dropdown.
- In the Element Key field, enter a variable name where the comparison result (true/false) will be stored (e.g., JsonComparisonResult).
- In the Parameter section, click Form and select Functions from the dropdown.
- Choose Compare Two JSON Files from the list of functions.
- Provide the JSON values for comparison in Object 1 and Object 2 fields respectively. For example,


- Click Save.


Outcome on execution: True since both JSON objects are identical.
- Example 2: Comparing JSON Stored in Variables.
Steps to Configure:
- Select Set a Variable Value from the Action dropdown.
- In the Element Key field, enter a variable name where the comparison result (true/false) will be stored (e.g., JsonComparisonResult).
- In the Parameter section, click Form and select Functions from the dropdown.
- Choose Compare Two JSON Files from the list of functions.
- Provide the variables containing the JSON values for comparison in Object 1 (e.g., JSON1) and Object 2 (e.g., JSON2) fields respectively.
- Click Save.


Expected Outcome on execution:
- If they are identical, the function returns true.
- If there is any difference, the function returns false.