Clear Version 6 (Java)

Action group: JSON


Description

The action removes all elements from the JSON object

Action icon


Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
JSONJSON for processingRobin.JSON
Yes
Results
JSONEmpty JSON or empty JSON arrayRobin.JSON

Special conditions of use

None. 

Example of use 

Task

Remove all items from 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", "Clear", "Save to file".

Implementation

  1. Assemble a robot scheme consisting of actions: 


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


  3. Set the parameters for the "Clear" action. 


  4. Set the parameters for the "Save to file" action. 


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

Result

The program robot completed successfully.

All elements have been removed from the JSON file. 

  • Нет меток