Compare Version 6 (Java)

Action group: JSON 


Description

The action compares two JSON files and returns "true" if they are same, and "false" if not.

Action icon


Settings of parameters

СвойствоОписаниеТипПример заполненияОбязательность заполнения поля
Параметры

Первый JSON

Первый JSON для сравнения

Robin.JSON


Да

Второй JSON

Второй JSON для сравнения

Robin.JSON


Да

Результаты

Результат

Логическая переменная, значение которой равно true, если файлы равны, иначе - false.

Robin.Boolean

true


Special conditions of use

None.

Example of use

Task

Compare two JSON files.

The first file test.json:

{
	"firstname":"Joe",
	"lastname": "Jackson",
	"gender":"male",
	"age": 28,
	"address": {
		"streetAddress": "101",
		"city": "San Diego",
		"state": "CA"
	},
	"phonenumber": [
	{ "type": "home", "number": "9349282382"}
	]
}

The second file test 2.json:

{
	"firstname":"Joil",
	"lastname": "Jackson",
	"gender":"male",
	"age": 31,
	"address": {
		"streetAddress": "101",
		"city": "San Diego",
		"state": "CA"
	},
	"phonenumber": [
	{ "type": "home", "number": "79349282382"}
	]
}

Solution 

Use the "Open", "Compare" actions. 

Implementation

  1. Assemble a robot scheme with the actions.

  2. Set the "Open" action parameters (1st file).

  3. Set the "Open" action parameters (2nd file).

  4. Set the "Compare" action parameters.

  5. Click "Start" in the top panel.

Result

The program robot completed successfully. The contents of the two files are different.