Set value Version 8 (Java)
Action group: JSON
Description
The action adds a key-value pair to the JSON if such key does not already exist, and updates the value if the key does
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
JSON | The JSON to which the object will be added | Robin.JSON | Yes | |
JSONPath | JSONPath describes the path to the JSON element. It always starts with a „/“ character. The corresponding keys are listed below. Indexes are used to access array elements (counting starts from 0). For example, the path „/key/1“ indicates that we are trying to access the second element of the array, which is accessible by the key „key“. | Robin.String | Yes | |
Value | The object to be added to the JSON as a value. Valid object types: collection, map, string, number, boolean. An error will occur if other types are used. Note: any value can be passed as a string. | Robin.Object | No | |
Results | ||||
Processed JSON | JSON containing new value. | Robin.JSON |
Special conditions of use
None.
Example of use
Task
Create a JSON and set its value: "firstName": "Joe"
Solution
Use the "Create a JSON", "Set value" actions.
Implementation
- Assemble a robot scheme with the actions.
- Set the "Set value" action parameters.
- Click "Start" in the top panel.
Result
The program robot completed successfully. JSON is created and the required value is set in it.
Обзор
Инструменты контента