I have been using a script to extract attachments (photos) from a geodatabase and place them into folders named based on a field. However, these data "begin their lives" as attachments on a hosted feature layer on AGOL. Is there a script to automate the conversion of a hosted feature layer to FGDB and download it from AGOL? This would allow me to schedule and automate the entire process (which would be simply smashing!). Can anyone help me out?
I ran into this article and tried it out on my end, but I am having issues with the layers downloading onto my machine. I got it to at least export the data and commented out the delete line to make sure they export, but I can't figure out what I'm doing wrong to have it download locally. Do you have any guidance?
Hi @AFackler_NAPSG - what is the error message returned?
I would use a print statement on your path to make sure it's going to an actual location on your machine - additionally, are you running this locally in an ArcGIS Pro Python environment?
Hi Peter, I am running into this same issue. My folder path is correct, but the content does not download to my folder location. I am running this on ArcGIS Notebook within our ArcGIS Online Organization. I am assuming the Notebook can't access or understand my local machine folder path. Any advice to make this work?
I came across this Esri Support KB article and was wondering if there would be a way to modify it to download hosted feature services that are part of an Organization?
Hi @ChuckWerstak1 - absolutely. You will just need to modify the search query to create a list of items in your organization. This will just look like items = gis.content.search(query='') as the search is limited to only your organization by default. This great article by my colleague goes over the different options for searching for content with the API for Python.