Integrate image-attachement in ArcGIS Survey123 report error 10.8.1

02-19-2021 08:24 AM
New Contributor


We’re using ArcGIS Enterprise 10.8.1, and we’re trying to generate Survey123 reports using the web interface.

Our surveys are published using Connect, and are based on feature services published through ArcGIS Pro. Our data is stored in a sde postgreSQL database.

We have enabled the attachments on the feature class before publishing the feature service.

When we try to generate a survey123 report, the attachments are not visible in the report. We are aware that this was a limitation with ArcGIS Enterprise, according to the documentation here

But, according to another documentation, it should now be possible with ArcGIS Enterprise 10.8.1

“If you are using ArcGIS Enterprise 10.8.1 or newer, as long as you do not use a feature service published from ArcMap, you can use images in your report template normally.”

The way we call the attachment to try to display it in the report is the one defined by the default report template generated automatically: ${​​​​attachmentquestionname | size:460:0}​​​​ with attachmentquestionname being the name of the question in the survey. This prints a blank in the report.

We have tried the following workaround :

${​​​​$file| size:460:0}​​​​

Which sort nof worked. But, the issue is that this workaround will put all attachments together in the report. However, our users have several questions where they require attachments and they want to display those attachments in the report in a specific order.

Is the “normal” behaviour where you can call a specific attachment question in the report supported in 10.8.1 or do you have to use the workaround?

Tags (1)
0 Kudos
1 Reply
Esri Regular Contributor

Hello @NicolasKleinEF

Survey123 uses attachment "keywords" to map which attachment is associated with what image question in the survey. Please use this link for more information on how Survey123 works with attachment keywords. 

As for the behavior being fixed with 10.8.1 that is for hosted Feature Services in ArcGIS Enterprise 10.8.1 registered Features Services from an Enterprise Geodatabase still have some more configuration as Survey123 can't manage the database data as it isn't coming from ArcGIS DataStore. 

ArcGIS Pro recently created a Geoprocessing tool to upgrade attachment tables so that they support attachment Keywords. 

After running the upgrade attachment tool your attachment table should support keywords now, meaning new images collected should have keywords associated with them and should work with Survey123 Reports, but the old images won't have keywords. 

The Support KB article above (1st link) provides a workflow for updating the attachment keywords for existing data, but the Survey123 team has been working on a Python script that will automate this process. 

I have attached the script below, but please note that the script is still in development so it is highly recommended to make a copy of the production data and test the script on that data before running it on the production data. 

Since the script is still in development it is still pretty limited in it's functionality. The script assumes 1 of 2 scenarios. A) there is only 1 image question in the survey, will ask for the keyword, and will apply that keyword to all images in the attachment table. B) if there are multiple image questions in the survey the script assumes the name of the image is <attachmentKeyword>-<timestamp> (which is the default attachment name if it was submitted in the Survey123 Field App) in which the script will read the attachment keyword from the image name and use that. 

Please let me know if you have any questions or run into any issues and I'll be happy to schedule a call to take a look into it. 

Thank you, 


Thank you,
0 Kudos