Value remains 1 and I can't understand why

Hello! I came back with yet another question :slight_smile: I’ve been working on an app that, once someone clicks a button titled ‘add spot’, it would retrieve the user’s current latitude and longitude using the location sensor and then would compare the value with its first 3 decimals with the latitude/longitude from airtable. The ‘alert’ value is supposed to change from 1, to 0 if your current latitude=latitude value from airtable, and, respectively, to -1 if current longitude=longitude value from airtable. If the condition (‘alert’=-1) is fulfilled, then it’s supposed to show an alert, and if it’s not, then a marker should be created and shown on the map.
After testing it, I noticed (using a label) that the 'alert’s value remains 1, the user’s coordinates are added to the airtable, yet no marker is added on the map. What’s the issue and how can I fix this?? Thank you so much!


1 Like

Can you explain why are you using get property ..... j in your for each loops?

Well, I thought this could be a way to get the value of the latitude/longitude in each ‘Latitude’/‘Longitude’ row, by going through each row with ‘j’ and getting the value each time, but I may be wrong!

1 Like

In your blocks, you are using list of values which will read the column and provide a list of all row contents for that specific column. So just use the j separately without the need of the get property.

1 Like

It works!! Thank you so much! However, there’s still no marker added on the map… :cry:

1 Like

The Add Marker block expects numbers but the Get Current Location block provides and Lat/Lon as text. You need to convert them to numbers by adding 0 to them so that they are accepted by the Add Marker block.

1 Like

Thank you very much for the help!! :blush:

1 Like