One way to parse a RealtimeDB response

disclaimer, this probably isnt the most efficient method. I feel this is completed with brute force and am open to suggestion

I wanted to share a method that I have gotten to work for my purposes. I have seen this posted and asked about a lot. I wanted to share how I am able to accomplish some retrieval and parsing of data from realtime DB.
For context: I save a ‘stored’ variable into realtime DB with a list of 50 numbers separated by a comma. The app is used to track data on 10 people It gives the opportunity to track up to 5 different things for each of the 10 people, hence the need for a list with 50 separate values.

The realtimeDB tree looks like this

I am using this to sync these scores across devices for any user given user. So if user A logs into 10 devices at once. all devices will display the same values and change at the same time if any of the devices make a change to any one of those numbers. Think google collaborative documents, but in my case, it is collaborative data collection for teams or families. IF user A logged in with team name JOE tracks something, user B logged-in with team name JOE will see the same data as user A in a synchronous fashion

here is how I parse the return. in this example, i was debugging still so i do not change any app/stored variables when the RealtimeDB is changed. if i wanted to do that, i would simply switch out ‘label35’ for a ‘set variable’ block and would reference the block that sets the RealtimeDB values in the first place! What a cool feature!

if you have any suggestions, please post them below! :raised_hand_with_fingers_splayed: :brain:
1 Like

Hi, @jared! :wave:

Seems a pretty nice way :+1:
Thanks a lot!

I have edited this topic’s category to #thunkable-cross-tutorials, since it qualifies better in tutorials category. :+1:

And I would like to give a small suggesstion to you, please consider -
Always prefer not to use # heading / ## heading in posts. It makes very tough to view in a smartphone, since the font is very big. If you want to however insert headings, Try with ### headings.

Thanks! :blush:

1 Like

Thanks! I was getting so frustrated with this! I think not having a background in programming made understanding how to use the realtimeDB storage and retrieval tough! I am very open to any suggestions or help to make this better! It seems like I can do this for all lists I have stored in my main app. I have 1 list with 50 values, 1 list with 100, 3 others with 10 each.

I wish i understood how to work with it in an object block format and to be able to use loops to pull the data i want. I’ll dream about that for now :slight_smile:

1 Like

Thanks a lot! :blush:

Don’t forget to consider this :wink: -

Thanks! :blush:

see above ^^ i changed it up :wink:

1 Like