Extract data from Firebase

I know its easy but can’t wrap my head around this. I have a set of data stored per user ID in firebase. For each user, I want to get the lat & lon datas so I create a marker on the map. My challenge now is how to get the lat and lon data the easiest way within the for each loop statement:


Sorry, I completely misread your question, and answered incorrectly.

For each user, what I do is make a csv string in firebase and call it all users or something like that. Then to display all the users data or to search in a list then use that. Now to find the data you must make sure that your objects and values follow a strict pattern/format, so you can simply substitute variables to find what you need.

From looking at your photo you shared, you will have a lot more loc123456… values. If a user wants to select specific possible locations, you must create another tag and make a csv string in this format:


This way a user can select from this list, and then following a strict format find what they need inside the users tag.

Is this what you meant?

1 Like

There are several ways.

An example for simple root objects like on your(scrFirebase screen)


Algorithm for very complex root objects

Add a prefix to all node names of parent objects that the user cannot enter. This can be one or more characters, for example:

  1. Make a list of objects. To do this, you need to find the position ⊙, then the position of the first character " and add to the list a line from to the found character"

  2. Repeat step 1 for all found ⊙

After that you will have a list of object identifiers, with which you can compile a path to the values ​​of any of their fields.