json to map()

This function can convert a JSON string into a map.

However, only elements/structures of the JSON string are transferred to the map that can be clearly mapped there. Note: This primarily concerns simple data types from objects, see first example.

If the function is successful, the return value is true, otherwise it is false (e.g. if an incorrect JSON string was specified in a).

Parameters


Parameter

Description

a

The JSON string.

b

Name of the map.

c

(optional) If true, the map b is emptied beforehand. Default: false.

Examples


Parameter a

Parameter b

Parameter c

Result

{"a": "hello", "b":"world"}

mymap

true

The map contains the key a with the value hello and the key b with the value world.

{"a": "hello", "b": [1,2,3]}

mymap

true

The map only contains the key a with the value hello.

[1,2,3]

mymap

true

There is no entry in the map.