How to get a very long list from firebase and sort it

Hi all Thunkers.

I have a very long list between 300 and 400 lines. And i like to get all text in the ap ones so I can sort it.
How can I do that in the best way. I need to find the customers near you from the list. So it is way to heavy if I need to go out on firebase with the Clod variable for each customer. That takes way to long time.
Hope you know what I mean.
I need the magic keyward to do this the fastest way, thanks.
Keep safe.

Simply set an App variable to the Firebase node you are interested in searching. It is surprisingly fast. Then you can searh/sort using the app variable. I’ve pulled Firebase JSON trees with over 30,000 nodes without any problems.

To sort a JSON list, check out More JSON - Sort Object List by Object Property.

I believe @muneer also has a search/sort solution.

2 Likes

Thank you so much. I am not sure what you mean by Firebase node. To get all text from the database. Can you show me the block to to that please?

image

Thanks have tryed that.
image
This way it is undefined

1 Like

in this way I just get the numbers (index)

of each customer

1 Like

Use this to see your DB entries as text
image

1 Like

From your data sample you can use something like this to retrieve title of the first entry

This is just an example

I dont think I can do it like that. Because I have several 100 customers in every city I have. So
like @drted surgest i need a “Create objec twith field block” with tilte, handle, latitude and longitude for each customer in each city. And that will never be the same numbers. Am I right?

Sorry to say but this bive the result “undefined”

1 Like

Why do you need to use indirect assignment to the app variables?

In my example I use the normal (basic type of app variable) to store the DBCopy and then use it to get the info.

Try using the normal app variables now to make it easier to test.

Here is a simple way to search the local tree for a value.

Finding the “closest” customer based on latitude and longitude is difficult in Thunkable. Here is a link to one of many discussion of the problem. Loading Map Markers Near User.

1 Like

You spelled “title” wrong. This is why you got undefined

image
see your block.

Thanks i also notised that. So I am back on track. But how is it to get the longitude and latitude that is in the child Address


image

1 Like

Place them the other way round in the block. latitude first then address.

yes like this right?


But the app crashes all the time

1 Like

:+1:
The app variable name already has a local copy of your DB so you should use this variable in the count loop instead of reusing the cloud variable bestofviborg

I would use this instead

so sorry but now I am a little confused.


What am I missing here??

1 Like

Place logitude on the top get property and place address in the lower get property

The order of the fields is in reverse.