How can I get each item from a list of tags on the fire base?

i’m in doubt how i can separate item from the tag list

That’s because I’m going to compare which list item is more like the value of my variable

1 Like

use this block from Control Section.

controls_forEach

and use like this,

blocks - 2020-02-08T110209.311

1 Like

@ImranTariq Does it work too?

Capturar1

1 Like

it will take items from list. else your procedure works or not it depends what you want to do with that item.

1 Like

desire get the item

1 Like

@ImranTariq i’ll get the item and remove

please explain… what you want?

2 Likes

@ImranTariq
Think of it as the "Tinder app.
I need to find out which user is closest.

I will use the database (firebase) for this application

When the user enters the app will raise the location of the same in the database.

However the coordinates will go up without “-” and “.”
will appear in the database in this model: “17219894685942”

These coordinates will be the tags in the database.

Example:
Capturar

I want to find out which person is 500 (subways) away from me.
I may have 20 people 500 metres away.
But I want to find out which person is closest.

@ImranTariq

Look what I did:

But it doesn’t work.
Problem: Always picks up the item: “17219894685942”
And I want the item (person/coordinate) that’s closest to me.
It was to pick up this item: “17220264685655”
Because that coordinate is the closest to me.
Can you help me?

but i cant see any valid coordinates here to compare? and how you are trying to compare them?

@ImranTariq

" lat: -17.22207 lon: -46.85675" == “17222074685675” ====== variable “coordenadas”

@ImranTariq

That’s the coordinates too
image

The only way I found to make the calculation is to mess with the precision of the decimal places of the coordinates.

i dont know if it is valid to store like this and then again get and then use to find difference better then to store in orignal format and then compare or try searching on Community, like this maybe helps,

that’s a strange format to store lat and long… and it will work only in your part of the world and not worldwice anymore (because you are removing the - sign)
Taifun

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.