Jump to content

Extracting Firebase JSON Data Into a LabVIEW Table


Recommended Posts

Posted

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.

image.png.1a1d5b3d185f5b9827cee12275d4383b.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 "}
}}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.