LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting Firebase JSON Data Into a LabVIEW Table

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. 

Screenshot 2025-11-24 201150.png

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:

  1. The top-level object contains dynamic child names (-Obew83hY0lgN7ac7JK0, -ObewEcv8G0LtSRTx92G, etc.), so I cannot index them directly.

  2. 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.

  3. 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 "}
}}

 

0 Kudos
Message 1 of 5
(253 Views)

An attempt using JSONtext by JDP Science

Might not be the most efficient implementation.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
Message 2 of 5
(222 Views)

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 objectsJSON named objects

Message 3 of 5
(176 Views)

If it's okay, can you please share your vi code..?

 

Best wishes,

Hyunwook Kim

0 Kudos
Message 4 of 5
(130 Views)

It is a snippet, you can download it and drag it onto the block diargram.

Here you go

0 Kudos
Message 5 of 5
(89 Views)