[Solved] How do I collect location (Long And Lat) Data from Google Maps and store that to a data source?

Hello, I am building an app that has to get a user’s location, Longitude and Latitude, send that data to a Google Docs Sheet and then display that onto Google Maps through API. This way I can show a Different program the locations of all the players in the game that do Collisions relive to where they are.

So far I have gotten the app to locate where I am at any given time, and then display that on google maps, but I need a way to store that data onto Google Docs or another data source.

Any help would be greatly appreciated.
Thanks, Levi

1 Like

Welcome to Thunkable.

If you add your Google sheet to your project as a Data Source then you can create a row or update the existing row as required.

1 Like

Ok here is a screenshot of what I have so far which gets the user’s location now where exactly?

Thanks Levi

2 Likes

I meant something like this. I connected the blocks to a button just for simplicity
image

I connected to a Google sheet and once this button is clicked then a row is added to the sheet with the user code along with user location.

Hope this makes it clear.

2 Likes

Thanks, but where do I find the App variable current User Block?

1 Like

The variable currentUser is a variable that I created to save the user name or code from the login screen. You can create your own.

1 Like

Sorry, can you send me a screenshot of how to do that, it’s not coming up on mine.
Thanks Levi

1 Like

Can you be more specific? how to do of what?

1 Like

Just how to Make this variable block
Screen Shot 2022-07-22 at 8.27.08 pm

Can you also show me how you have set up your Google Sheets just so I can get it to work as well?

Many Thanks, Levi

1 Like

Sorry, I am not trying to be annoying I am just new to thunkable.

1 Like

Here are our docs on variables! There’s several good and quick tutorial videos in there

2 Likes

Because you are new to Thunkable, I’m giving you a project that can be a starting block.
https://x.thunkable.com/copy/e873463825440fea0e23c7eb24ad63a5
The project has two screens, a login screen that upon successful login will take you to the other screen which you can use in your phone and whenever you click on the button, it will check that your name is available in the table and if it is then it will update the location otherwise it will add a new row.

This is the Google sheet that goes with the project

Happy Thunking

2 Likes

Thanks