Get keys Version 6 (Java)

Action group: JSON 


Description

The action returns collection of all JSON keys

Action icon


Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
JSONJSON for processing. Note: The action does not work with JSON arrays (start with „[„).Robin.JSON
Yes
Results
Collection of all keysA variable containing a collection of all JSON keys.Robin.Collection

Special conditions of use

None. 

Example of use

Task

Get JSON file key collection test.json and read the first key of the collection at index 0.

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 keys", "Get value by index" actions.  

Implementation

  1. Assemble a robot scheme with the actions.

  2. Set the "Open" action parameters.

  3. Set the "Get keys" action parameters.

  4. Set the "Get value by index" action parameters.

  5. Click "Start" in the top panel.

Result

The program robot completed successfully. The keys collection from JSON was obtained.

The key at index 0 is obtained.

  • Нет меток