Select to view content in your preferred language

Google Sheets not Dynamic in AGOL ?

2671
6
04-20-2021 10:41 AM
ChuckShaw
Emerging Contributor

I have created a google sheet so that I can have multiple people editing the same sheet at the same time. I have created a hosted feature service by using the Add Item from the Cloud and selecting it from Google Drive. My table has an address and city field so that AGOL will geocode the input addresses. Works fine once the connection is created.

However, when the google sheet is updated, it doesn't dynamically update in my map, unless I go through the routine of going to Contents, Select the Hosted Feature Service, Click on the Update Data Button and Overwrite Entire Layer. I'm then prompted to sign into my Google Drive account again, then the map will update.

Can this be configured to be dynamic without constantly having to constantly Update the Data and resigning into my Google Drive? 

0 Kudos
6 Replies
jcarlson
MVP Esteemed Contributor

The only way to make it seem like a "live" layer would be to schedule the update process. Thankfully, a recent update to AGOL added Notebook scheduling, so you can, quite easily!

If you're not familiar with it, you can use the ArcGIS Python API to update files, layers, and services. Once you have the notebook updating your layer properly, you can go to the Tasks panel and schedule the notebook to run at regular intervals.

- Josh Carlson
Kendall County GIS
0 Kudos
ChuckShaw
Emerging Contributor
That's excellent news!! Looks like I now need to learn how to use Python to
complete this solution.

Much thanks for pointing me in the correct direction.
ArcProOne
Occasional Contributor

Can you expand on how you did this for Google Sheets?  It just returns True but does nothing when I try:

 

item = gis.content.get('item_id_goes_here')
item.update(data='https://drive.google.com/file/d/google_sheet_id_goes_here')

 

0 Kudos
ChuckShaw
Emerging Contributor

Yeah, I still can't get it to work. I'm not savvy enough to figure out how to call the google sheet, via google's cloud, using python in ArcGIS Online's notebook.

0 Kudos
by Anonymous User
Not applicable

@ChuckShaw : If your locations in the google sheet are based on lat/long, if you add a point in google sheets it should automatically update. If you are geocoding the address from google sheets, it is not automatic.

0 Kudos
ChuckShaw1
Emerging Contributor

They would need to be geocoded, because this would be used in an EOC scenario. No one will be calling dispatchers with lat/long coordinates in this setting. So, I would need to figure out how to trick google sheets to populate a lat/long field upon completion of a geocoded address. That's where I remain stuck. I'm working around this dead end by using Survey123 instead. 

0 Kudos