Working with your Survey123 Photos

29435
45
03-22-2017 03:01 PM
JamesTedrick
Esri Esteemed Contributor
10 45 29.4K

Survey123 for ArcGIS lets capture photos anywhere in your survey.  These photos can then be accessed via several online and desktop tools.

Viewing your Photos

In ArcGIS terms, photos are attachments stored in the feature service’s database along with the rest of the survey data submitted.  There are a couple ways of exploring the images through the web:

  • The Data tab of the Survey123 for ArcGIS’s website displays the photos of a survey response when it is selected in the ‘Individual Response’
  • Sign in to your ArcGIS organization (for example https://www.arcgis.com) and you can view the data table of the service storing the data, including accessing the image attachments.  To do so, go to the Item Details of the service storing your form data and go to the ‘Data’ tab.
  • Links to attached photos can be displayed in the pop-ups of a survey point in a web map be available in a web application like a Story Map.

Exporting your Photos

Aside from having the photos stored with the survey data, there are analysis operations that may require the photos to be downloaded; for example, archiving the photos or using them in documentation/presentations.  Any individual photo can be downloaded from web sites by right-clicking on the photo and selecting ‘Save Image’ or right-clicking on the link and selecting ‘Download Link(ed File)’.  The most efficient way to export all of the photos is to download a File Geodatabase copy of the data and then follow the steps described in the Esri Knowledge Base article "How To: Batch export attachments from a feature class". Note that this will also download any signature question answers as well; signature questions will not have location information embedded.

Photo Metadata

When you take a photo, Survey123 records more than just the picture.  Photo metadata (camera type, camera settings and location information) are stored in what is known as the EXIF portion of the photo file. The location information in particular can enhance the understanding of a survey by providing additional points that can be associated with the survey.  A good example of this is inventorying equipment and facilities at a local park.  We can construct a form with the questions, including a photo, for the equipment are in a repeat of a form that gets filled out once per park.  Rather than asking for a point at every piece of an equipment, the collector can take a photo, from which the approximate location can be extracted.  The result is that the survey is recording multiple points without users needing to always add information onto the map.

To get the location information, the survey data must be downloaded as described above.  ArcMap and ArcGIS Pro both have a “GeoTagged Photos To Points” tool that then will create the new point features.  To make this process a little easier, I’ve combined the extract tool with the GeoTagged Photos to Points tool in Python Script and Toolbox.

45 Comments
RobertMarros
Occasional Contributor II

James,

Thanks for posting this. The MapPhotos tool you created was easy to use and very straight forward. I just have some comments and feedback about this process overall.

1. It would be nice if there was a way to do this on the fly and not have to rely on exporting your photos, taken from the surveys, and downloading them to a File Geodatabase. In my client's particular workflow, they would prefer to not only be able to see the pictures taken from the surveys in real time but also have the ability to see the location where the pictures were taken from as soon as a survey is sent. Right now they have to make due with waiting for us to export and run this process in order to create a layer that will allow them to see where these individual photos were taken from during a survey.

2. Along those same lines, when you do a batch download of these photos, the metadata doesn't indicate which Survey the particular picture was taken from. All you get is a field with Path (where the jpg is located) and the Name (taken from the Survey123) application. It would be great if there was an ability to tie a particular picture with the survey it was taken from.  

Thanks for all your hard work and for listening to our feedback.

Keep up the good work!!!

by Anonymous User
Not applicable

It sounds as though you should be able to do something along the following -

1). Within your Survey123 app enable the Geopoint field to collect the location of the survey; which would also be the location of the photograph, if it is not already enabled within your survey.

2). Set up a Web Map that consumes the Feature Service created when you published the Survey123 Survey from Survey Connect123.

3). Configure the pop up to include the field that contains the photo name as the Title of the photo pop up and the photos for viewing the attributes of the Survey Location.

4). Create a web app that uses the web map, which in turn uses the feature service of the Survey123 and contains the data and photos.

5). You will need to use Web app builder for ArcGIS Online or another App Studio for ArcGIS to configure the web app. 

6). Register the web app within your developers account.

7). Share this web app with the client; there are ways to require a username and password login,

 I'm not sure what the tool is that was created, but maybe you can look at the coding and then manipulate the code to concatenate/include the "Survey ID" or "Survey Name" or whichever field that contains the unique values to identifies the survey being submitted into the "Name" field calculation? that way once the photos are exported, there is a reference to which survey it was collected within. Lots of resources for editing and creating python coding.

Good Luck!

Mike

JonathanReger
New Contributor

Hi,

I have a Problem: When i want to run the tool, i get this error-message. I've worked with this tool ecactly the same way as i did the times before, but now it does not work...

JamesTedrick
Esri Esteemed Contributor

Hi Jonathan,

Is it possible to see the parameters used in running the tool, as well as the list of tables in the geodatabase?  It appears that for some reason the list of tables gets an item called 'in_table' that does not exist.  Given that the list of tables is generated be examining he geodatabase, this seems somewhat puzzling.

JonathanPendleton
New Contributor III

Is there no other more "user friendly" way to export photos from our surveys?

JamesTedrick
Esri Esteemed Contributor

Hi Jonathan,

At this time, there isn't a more user friendly method to extract the photos in bulk; this is one of the reasons I highlighted this in the blog post, to provide visibility.  In general, we normally want the photos to stay with the data of the rest of the survey, rather than be exported on their own.  It is somewhat easier to access individual images of a feature via attachment managers in ArcGIS Desktop.

JonathanPendleton
New Contributor III

Hi James,

This is really bad news for me. We really need to be able to work with photos in other analysis programs specific for our industry. If not, we might have to abandon Survey123. If your talking about survey forms with hundreds of entries, it isn't practical to open each picture and manually save them. I am assuming "How To: Batch export attachments from feature class" has to be done using ArcGIS Desktop is that right? I am also assuming an ArcGIS online subscription doesn't include access to the desktop software?

JamesTedrick
Esri Esteemed Contributor

Hi Johnathan,

Yes, the scripts that are referenced above do make use of ArcGIS Desktop technology, which, as you say, is not part of an ArcGIS Online subscription (though ArcGIS Desktop does come with an ArcGIS Online username for use in a subscription).

That being said, it's pretty easy to write a script to bulk download without needing Desktop.  The data storage (feature layer) can be accessed through a REST API, enabling pretty much any programming environment (for example, ArcGIS REST API  is the page explaining how to get a list of the images for an survey).  

One way to do this is with the new ArcGIS API for Python library (ArcGIS API for Python | ArcGIS for Developers ).  This does not require a Desktop license and can do a number things to access content.  I took a bit of time to create a script to download the attachments - it's available at MapPhotos/ExportAttachments.py at master · tedrick/MapPhotos · GitHub 

DavidStricklen
New Contributor

I am sure I am missing something obvious, but why is it that the exported csv cannot have hyperlinked images as a field just like the rest of the data?

JamesTedrick
Esri Esteemed Contributor

Hi David,

One thing that would complicate this is that the photos are still secured based on the settings of the feature service in ArcGIS Online; they may not be accessible to people you share the survey with.

LaurenMorse1
New Contributor

Hi, thank you for posting this. I have a question about the original post on the Survey123 photos. Is there are how-to on configuring the pop up in ArcGIS online to show the photos (more like a Map Note)? The field names that I used for photos are not available as options to display anything when I configure the pop up. The photos come up as hyperlinks and can be opened individually from within the pop up.

Do I have to create a web app for these to come up when the pop up is first clicked? 

(I'm looking for the photos to be there for students to have practice verifying the data, among other things.) Thank you.

JamesTedrick
Esri Esteemed Contributor

Hi Lauren,

Unfortunately, the pop-up in the Map Viewer has limited support for displaying attachments.  I'd recommending voting for  and perhaps commenting with your use case.

RobertMEIER
New Contributor III

How is photo collection handled when editing exiting surveys using the Inbox function?

I created a feature layer with data in it, enabled attachments. Created my survey from that feature layer, configured 2 fields as image. When I preview it, I see the camera and folder icons. but after I upload/publish the survey, then try it on my mobile device, the camera and folder icons are not there.

Any thoughts?

BrandonArmstrong
Esri Regular Contributor

Hi Robert,

Currently, photo attachments are not supported for editing via 'Inbox' functionality.  Please refer to the following Blog which explains this limitation...

Talk Like a Pirate Release (2.4)

"As of this release, the Inbox lacks support for downloading attachments. That is, you can use the Inbox against a survey that includes attachments, but  the Inbox will not populate  signatures, annotated images, audio or image questions.  All these types of questions will appear empty, as if they had no data. As for the rest of questions, you will be able to download  data for them and update  them as well.

 

Also, to play on the safe side, when you edit surveys from your Inbox we will disable editing on these types of questions. This means that if you open a survey from your Inbox  to make edits to it, all questions of type image (photos, signature, annotate, draw) as well as audio questions will appear not only empty, but also disabled. This is to avoid people from accidentally attempting to change data  in them.

 

We are considering adding support in a future release for editing attachments."

JamesWilson2
New Contributor III

Is there any way to customise how Survey123 writes to the photo metadata? my organisation takes a survey once it is complete and stores the table in one database, and the photos in another. We have a comments field for each photo in Survey123, it would be nice for the information to be written into the description in the exif header rather than into the database so that it can stay with the photo permanently. any ideas?

JamesTedrick
Esri Esteemed Contributor

Hi James,

Survey123 cannot write data from other fields into the EXIF information.  This is probably something better done after submittal as specifying the operation to write to the EXIF header would be a bit complicated.  

MarkBennett
New Contributor III

Hi James,

I have created a number of surveys using existing feature services. these surveys are integrated with WF and Collectors. Regarding photo, annotation, drawing, or attachments in general, I have following questions:

1. Can I select a file (not image file, any file such as 8.txt) as attachment?

2. For the type of image and appearance as Draw, can field user has the option to select and open an image as the backdrop instead taking photos? Ex. open a screen-capture or a existing photo.

3. Can user add multiple photos, drawing, or attachments? It seems one can use the "repeat" to add more than one images or voices.  However, it may force user to set up an"one-to-many" related table to handle repeated data items at one survey location. In case of attachments, Feature-service or FGDB seems already using a related attachment table to handle multiple attachments with the blob data type. So, can multiple attachments handled in Survey without created addition related table?

Survey123 is really a great product and thanks a lot for the excellent work!

Ming

JamesTedrick
Esri Esteemed Contributor

Hi Ming,

1. Survey123 currently does not support general file upload.  With some new changes to iOS 11 enabling file access, we will be looking to see what we can provide in terms of support in the future

2. For the draw appearance, you can define a background image in the default column (this can even be a formulas to help set the appropriate from multiple).  A user can manually choose when the image has the annotate appearance.

3.  You are correct about the current behavior of multiple photos; the only way currently to specify this is via the begin repeat/end repeat statement.  We plan on improving how attachment-only (photo, audio) repeats are handled in the future.

MarkBennett
New Contributor III

James,

Thanks for the prompt responses to my questions!

 All these tree questions are related to the behavior for add attachments to a survey. If there is a "wish list" for the functionalities of Survey123, may I add the followings:

1. The behavior of handling the attachments (for images, audio, video, text files or any other files) is preferred to be the same as handling attachments for a feature service (Have a related Attachment table and using GlobalID as the keys).

2. A "begin/end attachments" type may be used to handle the multiple attachments with same type.

3. For the annotation, it will be great if user can select (not pre-defined) an image as the background of drawings. If user can open a Web Map and draw on the map, it is also very useful.

Thanks and looking forward to seeing even greater Survey123!

Ming

JamesTedrick
Esri Esteemed Contributor

Hi Ming,

Thanks for the suggestions.  We are looking at providing some level of support for the functionality you are describing. 

AdamDaily
Occasional Contributor II

James,

I'm having a similar traceback error using this script but I noticed this post was from last April - has the format changed with this? I see the 3 fields needed in my Attachments Table named 'images_ATTACH'. The script begins to run and exports 165 photos to my output folder before the fail occurs. I have nearly 1500 pictures in this table. Any ideas on the following error?

JamesTedrick
Esri Esteemed Contributor

Hi Adam,

This is essentially a Python 2.x issue- support for Unicode wasn't completely baked in and there are points where encoding checks need to be put in.  The main solution will be to migrate this to ArcGIS Pro/Python3.x .  

AdamDaily
Occasional Contributor II

Thanks James,

We do have a few machines running pro so I will keep that in mind going forward as we will have to do this process a lot.

For anyone else getting this error, it is occuring within the ATT_NAME FIELD of the related pictures table. Search the jpeg names for the encoding errors like circled below. I found 3 spots in my table that needed to be fixed for this script to run all the way through:

ChadFoster1
New Contributor III

James,

Your script to export the data and attachments worked well, but I am having trouble viewing the photos that should be attached to the features.  Any ideas? The Survey123 form has 40 repeats for pictures, so there are many ATTACH and ATTACHREL tables associated.  All of the tables are populated.  I really want to be able to view the pictures with the features so I can relate this data back to the features in Collector for our users to see. 

  

TravisBock2
New Contributor II

Hi James! 

It now the future... Have there been any improvements in how attachment-only (photo, audio) repeats are handle?

Thanks!

Anneka_France
Occasional Contributor II

I don't see any issue with including a hyperlink in the .csv, even if you need to sign in the view the photos if they are set as private. 

CharlesKeller
New Contributor

it is now the future +11 months - bump?

I just started my search of this topic so maybe i will find a better/easier way to bring survey123 tags and photos into a map... back to more searching.

Anneka_France
Occasional Contributor II

There is now a workaround using arcade expressions, however this is not dynamic and you will need to regenerate the URLs each time new records are added: https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2019/03/22/show-attachments-in-po...

JamesTedrick
Esri Esteemed Contributor

Hi Chad,

Yes, I can understand - viewing related record's attachments can be difficult. The attributes pane in Pro is probably the best at it.

deleted-user-j8u2waHrLNX3
New Contributor II

Hi James,

I had a question about downloading photos within repeats. The survey I created has a repeat question that includes a select_one question asking the user what is contained in the photo that they submit. They select an answer such as upstream, downstream, fallen tree ect. then they take the photo. Unfortunately when I batch download the photos this information is not included in the photo's record.Changing the name of each photo would take far too long for those out in the field as many photos will be taken for each survey. I believe Robert Marros had a similar question at the very beginning of this thread but that was two years ago and I was wondering if any new functionality has been added to fix this issue. 

Thanks for your help!

Darren 

JamesTedrick
Esri Esteemed Contributor

Hi Darren,

There isn't any new functionality that addresses this.  It would be possible to associate this data on download via python scripting, doing a feature-by-feature download of attachments (the AttachmentManager in the ArcGIS API for Python would be a good place to start arcgis.features.managers module — arcgis 1.6.0 documentation )

AdamBakiera
Occasional Contributor

Are there any updates regarding a way to tie location information with downloaded photos? The script works great but in our case, we collect thousands of points when a hurricane hits, it will be very cumbersome to go back and try to figure out which photos belong with which location. 

Thanks!

DougBrowning
MVP Frequent Contributor

We require file storage also (vs in the GDB).  So when I am extracting I create a directory with the name of the PrimaryKey.  Then I create a PhotoLinks table that has the path to the dir + the PrimaryKey.  Then create a Relationship class from the main Point to the PhotoLinks table and then it is all connected. 

You could add also add a field right in the point.  So a field called PhotoLink which has a calc of path + "/" + PrimaryKey.

In my script I am also renaming the photos based on field I calc in the form.  I also have a script that auto creates all the PrimaryKey dirs for me from the data.

MikailaBell
New Contributor III

>Links to attached photos can be displayed in the pop-ups of a survey point in a web map be available in a web application like a Story Map.

Can you please link to more info, or a sample of this functionality? That is precisely what I need to enable, and this is the only mention of it I can find.

Neither of these resources address this question, from what I can tell:

1. https://doc.arcgis.com/en/arcgis-online/create-maps/configure-pop-ups.htm 

2. https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/configure-pop-ups-tips-photos/

AdamDaily
Occasional Contributor II

Mikaila Bell‌,

You don't really need to enable this function, it already is. Just add your survey layer to a web map and click on a point. Related photos appear under Attachments in the attribute table. You can also configure pop-ups for layers in a map to display photos for building applications. 

https://doc.arcgis.com/en/arcgis-online/create-maps/configure-pop-ups.htm

               Web Map                                                                     Operations Dashboard

 

MikailaBell
New Contributor III

Hi Adam Daily

Nope! You are talking about a default pop-up, in a web-map. And, you're right -- that does NOT need to be configured to show the link at the bottom, to show photos or links to related tables with photos. 

However, that's not what I need. I am looking for a mechanism to include the photo link in a *custom configured* pop-up. 

You linked to the same article that I linked, which does not cover the custom configuration embedded photo hyperlink for Survey123-captured pics. 

Thanks for the response. Please let me know if you can clarify a resource for custom configuration of photos in pop.

James Tedrick‌ do you have any suggestions?

AdamDaily
Occasional Contributor II

For specific customization within an application, you might want to look into ArcGIS Online Assistant. This allows you to login and view items you own in your AGOL account. You can edit an items JSON, and to do a fair amount of customization within your applications, outside of the boxed default tools provided in AGOL.

ShuilingYu
New Contributor

Hi James,

Thanks for providing resources for how to deal with photos in Survey123. While I found one potential photo uploading issue in Survey123.

  • Background:
    • 1 iCloud account is shared between different field iPads;
    • Repeat question for photos may be involved in Survey123 form
      • Need to download photo based on relate table id and attachment id
  • Situation
    1. If attached photo cannot show thumbnails, that photo won't be attached successfully. (Refer to screenshot)Image attached without thumbnail
      1. Possible reasons: attached live / HDR photo; attached photo is not downloaded from iCloud
      2. For some of the cases, I cannot find the reason why attached photo doesn't show thumbnail
    2. In the form where the relate table is involved, if the situation mentioned above happened, the rule to download photos (based on table id and attachment id) is not applied anymore.

  • Temporary Solution: Emphasize to field users to make sure the attached photo shows thumbnail.
  • Questions: I am not sure whether this issue is related to the backend of Survey123 or related to the format of a photo. If there are some restrictions on file type for photo uploading, I would like to know these restrictions.
JamesTedrick
Esri Esteemed Contributor

Hi Shuiling,

I would ask that you file an Esri Support ticket to look into the behavior regarding the photos not appearing in the form - I haven't seen that behavior, even from photos that are in the iCloud gallery, before.

ShuilingYu
New Contributor

Thank you James, I will get in touch with Esri Support and update the Support result in this blog if needed.

MichelleWilliams1
Occasional Contributor III

Good day, Everyone,

May I get your help? 

I'm getting this error:

FAIL: Logging in to Survey
exception:
[Errno socket error] [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
['socket error', error(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond')]
<type 'exceptions.IOError'>
544

These are my parameters:

...Test.gdb

Prefix: BSI

https://services5.arcgis.com/z6hI6KRjKHvhNO0r/arcgis/rest/services/service_8592fecd30204b119b8b13af6...

America/Los_Angeles

https://www.arcgis.com 

& my login credentials

JamesTedrick
Esri Esteemed Contributor

Hi Michelle,

Just to check, which script are you running (as there are multiple posted throughout this)?

A connection error indicates that Python is unable to contact the server.  This may be caused by a few different things, including internal firewalls that restrict which programs can access the internet.

MichelleWilliams1
Occasional Contributor III
JamesTedrick
Esri Esteemed Contributor

Hi Michelle,

Thanks.  This is a little off-topic for this blog (which is focused on working with photos).  As mentioned above, this indicates a possible issue contacting ArcGIS Online using python from your computer.

CédricVilleneuve
New Contributor III

Hi James, thanks for this Topic. I just created the script but realize it does about the same than doing "save all" in the attachment viem in Arcmap. My question is: is it possible to give the script the "batch" option to put all the ATTACH table in a .gdb?

In the mean time, is there any way to create a point feature  from the pictures directly from the attchment table as we would do with geotagged Photos tool?

Thanks in advance