Survey123 Picture Attachments to Survey Questions

175
6
Jump to solution
2 weeks ago
JoelClark2
New Contributor III

We recently recreated a Survey123 survey in Portal for ArcGIS. The survey has 2 "picture" questions and 1 "signature" question.


The survey was previously in AGOL, but I downloaded the feature service including the attachments and loaded these records into the survey feature service hosted in Portal.


The feature service in Portal has the attachments, and the attachments can be seen in the feature service data tab, but the Survey123 form is not "aware" that the attachments go with each of the three survey questions. For instance when viewing the survey in edit mode the three questions show no image, and when generating a Word Doc report the picture attachments are not shown for the questions.


What is the mechanism by which Survey123 relates a question to an attachment file so I can resolve this?

0 Kudos
1 Solution

Accepted Solutions
JoelClark2
New Contributor III

For future readers of this question, I found the answer.

Inside the attachments table in the Portal/AGOL backend is a field called "KEYWORDS". Set the value of this field to the name of the survey question, and the image will then be shown as the answer to the survey question.

However, in Portal or AGOL, you do not have access directly to the attachments table. There's two workarounds. Option 1. You can export and download the feature service item as a File GDB. Make the edits (this must be done in ArcGIS Pro) to the downloaded attachments table KEYWORDS field and share to Portal/AGOL and overwrite the existing feature service. Option 2. You can utilize code and the ArcGIS Server REST API to download all the attachments, delete the attachments from the feature service, and re-upload the attachments with the proper KEYWORDS. In the "addAttachment" REST operation there's a parameter called "keywords" that allows for this. https://developers.arcgis.com/rest/services-reference/enterprise/add-attachment.htm

Thanks!

View solution in original post

6 Replies
Strahanjen
New Contributor III

Hi Joel,

While I'm new to this and don't have a direct answer to your question, here's an approach for copying your feature service from AGOL to Portal that I think will make an exact clone and keep all of the relationships intact. I use this approach when I need to clone a Feature Service, and it works a better than downloading an export and building the service from that. 

https://support.esri.com/en/technical-article/000022252

 

0 Kudos
RosemaryHatch
New Contributor II

From what I could find when we had this issue, using Portal prior to 10.8.1 does not allow you to tie the images back to the question (we ended up having to do the Survey in AGOL).

https://doc.arcgis.com/en/survey123/browser/analyze-results/knownissuesanalyzeresults.htm

 

0 Kudos
JoelClark2
New Contributor III

We are using Portal 10.8.1

0 Kudos
JoelClark2
New Contributor III

For future readers of this question, I found the answer.

Inside the attachments table in the Portal/AGOL backend is a field called "KEYWORDS". Set the value of this field to the name of the survey question, and the image will then be shown as the answer to the survey question.

However, in Portal or AGOL, you do not have access directly to the attachments table. There's two workarounds. Option 1. You can export and download the feature service item as a File GDB. Make the edits (this must be done in ArcGIS Pro) to the downloaded attachments table KEYWORDS field and share to Portal/AGOL and overwrite the existing feature service. Option 2. You can utilize code and the ArcGIS Server REST API to download all the attachments, delete the attachments from the feature service, and re-upload the attachments with the proper KEYWORDS. In the "addAttachment" REST operation there's a parameter called "keywords" that allows for this. https://developers.arcgis.com/rest/services-reference/enterprise/add-attachment.htm

Thanks!

View solution in original post

MicZatorsky_AEC
New Contributor III

WRT 

Option 1. You can export and download the feature service item as a File GDB. Make the edits (this must be done in ArcGIS Pro) to the downloaded attachments table KEYWORDS field...

I have exported my AGOL-hosted Survey123 FGB, and in the attachments table there are no KEYWORDS and EXIFINFO fields as shown in your screenshot.  Where did they come from?   My survey is 12 months old, is this from a newer release of Surevy123, or is it a Portal-only thing?

Thanks

0 Kudos
JoelClark2
New Contributor III

My understanding from discussing with Esri support is that picture-question editing is recent since Portal version 10.8.1, though it's been in AGOL for some time.