Parse Data Dictionary

This function block extracts a single value from a dictionary provided as text or as a dictionary object. It helps you pick a key from the incoming data and outputs the associated value for use in the rest of your system.

πŸ“₯ Sockets as inputs

Input Dictionary (String) Provide a JSON-formatted string or an already-parsed dictionary. Example format shown in the UI helps you prepare the input.

πŸ“€ Sockets as outputs

Output Data The value corresponding to the key selected in the dropdown. If the selected key is not present or no input is provided, output may be empty.

πŸ•ΉοΈ Controls

Select key from input data dict Dropdown to pick which key from the incoming dictionary you want to extract.

Input example / helper text Informational text showing an example input format (e.g. {"name": "product", "id": 345}) to guide you.

🎯 What this block does

  • Automatically reads incoming JSON-like text or dictionary inputs and exposes the available keys.

  • If the available keys change, the dropdown updates so you can select the new key.

  • Outputs only the selected value (not the whole dictionary), making it easy to feed single values downstream.

πŸ“ How to use

  1. Feed a JSON string or dictionary into the Input Dictionary (String) socket.

  2. Open the Select key from input data dict dropdown and choose the key whose value you need.

  3. The chosen value will appear on the Output Data socket for other blocks to use.

βš™οΈ Running behavior

When the block runs it checks the incoming input. If it is a string representing a dictionary it parses it and lists the top-level keys in the dropdown. When you choose a key the block outputs the associated value on Output Data. The dropdown list updates automatically whenever new input presents a different set of keys.

πŸ’‘ Tips and Tricks

  • Use with communication blocks to process incoming messages:

    • Connect REST API - Get (use its Response) to parse API responses.

    • Connect MQTT Subscribe (use its Data) to extract fields from incoming messages.

  • Use with storage/flow blocks:

    • Feed Data Read Local or Data Read Global outputs to parse stored dictionaries.

    • Pair with Data to JSON when you need to convert structured data into a string first, then parse a specific key here.

  • Save or inspect results:

    • Send extracted Output Data to CSV Export or Image Logger (if saving metadata) for logging.

    • Use Debug Input to quickly inspect the parsed value during development.

  • Validation hint: If you are testing manually, try sending a value from String Input to confirm the dropdown populates correctly.

πŸ› οΈ Troubleshooting

  • Nothing appears in the dropdown: make sure the input is a valid JSON string or a dictionary object and that it contains top-level keys.

  • Invalid input format: provide JSON-style text (keys and strings with quotes) or a proper dictionary from upstream blocks.

  • Selected key yields empty output: confirm that the key exists in the current input dictionary and that you selected the correct dropdown entry.

  • Keys change but dropdown does not refresh: feed a new dictionary (or re-evaluate the upstream block) so the block can detect the new key set and update the list.

Last updated

Was this helpful?