I have been trying for days to get this to work with no joy so I was hoping someone could come to my rescue.
I have an airtable sheet that has some columms including Latitude and Longitude. I would like to plot those as markers on a map once the app starts. I have gone over all of the tutorials, videos and all the different code blocks I could find and have not had success.
Trying to iterate over the sheet does not put the markers on the map. Sometimes it crashes and sometimes not but still not location markers.
I am really at my wits end trying to get this to work. Any help would be greatly appreciated.
I know Jane (a thunkable employee) had this as a tutorial but it crashes the app when launching. I have tried many variations of that but they do not work. This is the link to her tutorial (Airtable Map (show image when Marker pressed))
At a glance
Try removing the Airtable âGetRowâ block from the âfor eachâ block and use only the âaddMarkerâ block. You will also need to swap the âvalueâ block for the variable âjâ block.
As is, you are telling it get a row for every row and trying to pull the row number from the latitude property found inside the longitude property (which doesnât exist).
Remember to always comb over your own project carefully when following a tutorial to ensure you havenât missed the little things -
Let me know if this doesnât fix it and I will dig deeper for you!
Thanks for your reply, I really appreciate it. I tested what you suggested and the app crashes at launch both from the live test and installing the app to my phone. Here is the screenshot of my blocks after changing it.
Iâd suggest you do a bit of error hunting. Add a label to your design and before the j-loop add an if error display error block. Then youâll know if the problem is with getting the rows or adding the data to the map.
Then Iâd use a very basic version of the Airtable (two or three rows) and test that.
Note that if any of your rows have empty latitude or longitude cells attempting to get that property will fail and the app will crash (because the property doesnât exist). Empty rows will cause the same problem.
If having empty cells is unavoidable, youâll need an error protection routine that gets the properties of j, checks if the required property exists and only gets it if it exists.
Hope that helps.
I added a display error block and label and they were coming up null when testing. Then I re-read what you said about empty rows crashing the app. After checking my airtable, I noticed that there was an empty blank row at the bottom of my sheet. Once I deleted that row and tested it worked!!! I canât thank you all enough for helping me troubleshoot and fix this!
You could check for a value being present or length of characters in a cell needs to be over 1 or some other method to ensure there is data in the cell
Do you have any blocks examples of this? I am thinking through it but can not seem to come up with the logic. I am not sure of which blocks will get me this check. It would actually have to check all rows for data, correct?
Here I call an api. Split the response into lists. Then run a loop over the lists and add a marker each time. On my iPhone 100 markers every 5-7 Took approximately .5-.75 sec
Here is what I have so far. The app doesnât crash but I donât get any markers either. There really only individual cells that will be blank at this point and not necessarily an entire row although I guess that could be the case at some point.
Here is another one I tried based on one of your examples for " How to query data from airtable". The app is not crashing which I guess is good:) but still no markers.