11-24-2025 10:16 PM
I’m working on a LabVIEW application that retrieves measurement logs from Firebase. The Firebase API returns data as a nested JSON object where each entry has an auto-generated key. Each entry contains fields such as DATE, TIME, RESULT, TEMP, etc.
My goal is to parse this JSON into a 2D string array so that each Firebase record becomes one row in a LabVIEW table indicator.
I’m using the JSONtext library, but I’m having difficulty iterating through the nested keys and reliably building each row. My main issues so far:
The top-level object contains dynamic child names (-Obew83hY0lgN7ac7JK0, -ObewEcv8G0LtSRTx92G, etc.), so I cannot index them directly.
When I extract values using Get JSON Object Keys + Unflatten from JSON, the order of keys is not guaranteed, so my 2D table rows become misaligned.
Attempts to build rows inside a loop give me only a 1D array unless I carefully manage the auto-indexing tunnels.
Here is a minimal reproducible example of the Firebase response:Has anyone done this before or can provide an example of how to reliably transform Firebase JSON data into a LabVIEW table?
{"data": {
"-Obew83hY0lgN7ac7JK0":{"DATE":"20251015","RESULT":"NG","TEMP":"20.2\\r\\n","TEMP_MAX":0,"TEMP_MIN":0,"TIME":"21:54:09 "},
"-ObewEcv8G0LtSRTx92G":{"DATE":"20251015","RESULT":"OK","TEMP":"","TEMP_MAX":0,"TEMP_MIN":0,"TIME":"21:54:29 "},
"-OeUEMm0u55cSRyy4OhH":{"DATE":"20251119","RESULT":"OK","TEMP":"","TEMP_MAX":0,"TEMP_MIN":0,"TIME":"21:09:57 "},
"-OeUEO-CYBUUw_gtiab9":{"DATE":"20251119","RESULT":"OK","TEMP":"","TEMP_MAX":0,"TEMP_MIN":0,"TIME":"21:10:02 "}
}}
11-25-2025 12:02 AM
An attempt using JSONtext by JDP Science
Might not be the most efficient implementation.
11-25-2025 04:10 AM
When you have named objects of the same type, you can use a Map with JSONText. You would need extra work to keep the order in the original JSON. Also parsing the numeric values and converting back into strings feels wrong.
JSON named objects
11-25-2025 03:49 PM
If it's okay, can you please share your vi code..?
Best wishes,
Hyunwook Kim
11-26-2025 03:57 AM
It is a snippet, you can download it and drag it onto the block diargram.
Here you go