Open Version 8 (Java)

Action group: JSON


Description

The action opens JSON and returns an object to manipulate the contents of the file

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
The path to the filePath to the file that will be openedRobin.FilePath
Yes
EncodingFile encoding.Robin.String
Yes
Results
ResultObject for processing content of the fileRobin.JSON

Special conditions of use

None. 

Example of use 

Task

Get the number of elements in 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 actions "Open", "Get a number of elements in a JSON". 

Implementation

  1. Assemble a robot scheme consisting of actions: 


  2. Set the parameters for the "Open" action. 


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


  4. Click on the "Start" button in the top panel.

Result

The program robot completed successfully. The number of elements has been obtained. 


  • Нет меток