Get a number of elements in a JSON Version 6 (Java)

Action group: JSON 


Description

The action returns the number of elements in a JSON.

Action icon


Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
JSONJSON for processingRobin.JSON
Yes
Results
The number of elementsThe number of elements in the JSON.Robin.Numeric

Special conditions of use

None.

Example of use

Task

Get a number of elements in a JSON file test.json.

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

Solution

Use the "Open", "Get a number of elements in a JSON" actions. 

Implementation

  1. Assemble a robot scheme with the actions.

  2. Set the "Open" action parameters.

  3. Set the "Get a number of elements in a JSON" action parameters.

  4. Click "Start" in the top panel.

Result

The program robot completed successfully. The number of elements was obtained.

  • Нет меток