История страницы
...
Get value Version 3 (Java)
Группа действийAction group: JSON
Описание
Действие возвращает значение из JSON по JSONPath
...
Description
The action returns the value from JSON through JSONPath.
Action icon
Параметры действия
...
Action parameters
Input parameters
JSON - JSON для обработкиfor processing.
JSONPath - JSONPath описывает путь до элемента JSON.
Выходные параметры
Значение - Переменная, содержащая значение из JSON. Значение возвращается в виде строки.
...
describes the path to the JSON element.
Output parameters
Value - variable containing value from JSON. The value is returned as a string.
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
JSON | JSON for processing | 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 | |
Results | ||||
Value | Variable containing value from JSON. The value is returned as a string. | Robin.Object |
Особые условия использования
Отсутствуют.
Пример использования
Задача
Special conditions
None.
Example of use
Task
Get the lastName element value from a JSON-file Получить значение элемента lastName из 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 value" actions.
Реализация
Implementation
- Assemble a robot scheme with the actions:
- Set the Собрать схему робота ,состоящую из действий:
Настроить параметры для действия "Open" action parameters. - Настроить параметры для действия Set the "Get value" action parameters.
- Нажать на кнопку Click "Старт" в верхней панелиStart" in the top panel.
Результат
Result
The program robot completed successfully. The value of the needed element was obtained.Программный робот отработал успешно. Значение требуемого элемента получено.