Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Convert to dictionary Version7 (Java)

Группа действийAction group: JSON 

Описание

Действие преобразует JSON в словарь.

...

Description

The action converts JSON to a dictionary. 

Action icon


Параметры действия

Входные параметры  

JSON                                                JSON для преобразования

Выходные параметры

Результат Словарь, который содержит данные из JSON.

...

Action parameters 

Input parameters 

JSON - JSON for converting

Output parameters 

Result -  the dictionary, which contains the data from the JSON

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
JSONJSON for converting. Note: The action does not work with JSON arrays (start with „[„).Robin.JSON
Yes
Results
ResultThe dictionary, which contains the data from the JSON. Note: because a map is an unordered data structure, the order of the JSON elements is not preserved during conversion.Robin.Dictionary

Особые условия использования

Отсутствуют.

Пример использования 

Задача



Special conditions of use 

None.

Example of use 

Task

Convert the JSON test.json contents to a dictionary. Преобразовать в словарь содержимое JSON test.json

Блок кода
titletest.json
linenumberstrue
collapsetrue
{
	"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", "Convert to dictionary" actions

Реализация

Implementation

  1. Assemble a robot scheme with the actionsСобрать схему робота ,состоящую из действий


  2. Настроить параметры для действия Set the "Open" action parameters


  3. Настроить параметры для действияSet the "Convert to dictionary" action parameters.  


  4. Нажать на кнопку Click "Старт" в верхней панели.

Результат

  1. Start" in the top panel. 

Result

The program robot completed successfully. JSON was successfully converted to a dictionaryПрограммный робот отработал успешно. JSON успешно преобразован в словарь