Decode JSON
This section is available only in EnglishThis block is used to convert data in JSON format to the dictionary data type. Block containing data in JSON format is connected to the input, in most cases “message” block with “raw” key. Output of this block is a dictionary data type.
XML representation of decode_json block
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="decode_json">
<value name="JSON">
<block type="message">
<field name="OBJECT">raw</field>
</block>
</value>
</block>
</xml>
Block is used on the “set item to” row in the example:
- loads data from “raw” key of “message” dictionary, created dictionary is saved into the “item” variable,
- variables “ip” and “user” will appear in the processing result.
{
"user": "administrator",
"ip": "8.8.8.8"
}