How to access Survey123 photos via ArcGIS API for Python

2595
2
Jump to solution
02-23-2018 02:02 PM
NathanielEvatt
New Contributor III

Following instructions from this blog post I am able to access Survey123 photos from AGOL, the Survey123 web interface as well as from desktop applications via arcpy.  However, I am struggling to find out how to access the images via ArcGIS API for Python.  The feature service doesn't have any table info about the attachments, despite the fact that when you open the data table in AGOL, the photo data is there.  Is it possible to get access to the joined table that is displayed in AGOL when you click "show table"?

I am hoping to be able to get access to a link or something that i can actually download.  Is this possible?

Thanks, 

Nat

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Hi,

 I have attached below a Jupyter Notebook file with some code you can use.

The Notebook looks something like this.

You will want to change the ID of your survey's featureLayer item, the output path and username...

If your attachments are in a related table, make sure you adjust the layer index in myFLItem.layers[0] accordingly.  Otherwise the script assumes that your attachments are in the first layer in your feature service.

If you want to take this to the next level I recommend this Python script developer-support/python/general-python/download-attachments at master · Esri/developer-support · Gi...  published by Michael Kelly

View solution in original post

2 Replies
IsmaelChivite
Esri Notable Contributor

Hi,

 I have attached below a Jupyter Notebook file with some code you can use.

The Notebook looks something like this.

You will want to change the ID of your survey's featureLayer item, the output path and username...

If your attachments are in a related table, make sure you adjust the layer index in myFLItem.layers[0] accordingly.  Otherwise the script assumes that your attachments are in the first layer in your feature service.

If you want to take this to the next level I recommend this Python script developer-support/python/general-python/download-attachments at master · Esri/developer-support · Gi...  published by Michael Kelly

NathanielEvatt
New Contributor III

Hi Ismael,

Thanks very much, that is just what i needed.  

For anyone else that stumbles upon this, the images are all handled in the attachment property: Layer Attachments | ArcGIS for Developers