Select to view content in your preferred language

"No attachments found" in the Attachment Viewer App, despite working attachments

7936
18
Jump to solution
06-14-2021 07:22 AM
Labels (1)
BillSchlatter
Regular Contributor

I've seen several older threads on this general topic, but none of the solutions I've seen in them have worked for me.  

I'm currently testing out the Attachment Viewer configurable app in ArcGIS Online as a replacement for the "classic" Shortlist storymap template.  It looks like the app should be perfect for our purposes - an image-focused layout with a map to provide geographic context.  However, I can't seem to get the app to work with the test data that I've cobbled together so far.  When previewing, I get the "No attachments found" message, and when I open the builder, a small warning box says, "This application requires a layer that supports attachments and has 'supportsQueryAttachments' set to true."  

I'm not sure how to directly check the 'supportsQueryAttachments' flag, but the Query Attachments operation seems to be working just fine on the REST service.  

The only thing I'm aware of that I'm doing differently from the tutorials and walkthroughs I've found is that the attachments aren't being created using any of Esri's field collection apps.  I used the Enable Attachments and Add Attachments tools in ArcGIS Pro to add the image attachments to the layer in an offline file geodatabase before uploading that layer to AGO.  

Does anyone have any idea what I'm doing wrong, or how I could try to fix it?  

For reference, here is the layer service I'm using: https://services1.arcgis.com/xUx8EjNc6egUPYWh/ArcGIS/rest/services/TAP_Test/FeatureServer/0

The AGO item page for the layer: https://semcog.maps.arcgis.com/home/item.html?id=dccf0576266a4ac2b19c53dbabcbd5bc 

The test app: https://semcog.maps.arcgis.com/apps/instant/attachmentviewer/index.html?appid=9b5d26ab4f80430782584f... 

And the test map: https://semcog.maps.arcgis.com/home/webmap/viewer.html?webmap=39cb00ff9b654d92b29a6b4cf6d36c21 

0 Kudos
1 Solution

Accepted Solutions
BillSchlatter
Regular Contributor

I did some more digging, and found a workaround. 

The important details: Esri is aware that the Attachment Viewer app in ArcGIS Online is basically broken at the moment.  The don't have a timeline for fixing it, but you can get around it if you can host the code on your own server.  

The workaround: Download the source code from Github (https://github.com/Esri/attachment-viewer).  Copy your AGO app's App ID into the quote marks on the "appid" line in dist\config\application.json and save the file.  Copy the contents of the dist folder to your web server, and it should work.  

The bug documentation: https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEzNzI4MQ== 

From what I can see, it looks like the issue is that the latest version of the Attachment Viewer app is broken on AGO.  The Github version seems to have been rolled back to an earlier version that actually works, but for whatever reason, they didn't do the same with the default code used by AGO.  I'm making a few assumptions that may not be safe, but that's the best guess I have for what's going on.  

View solution in original post

0 Kudos
18 Replies
MichelleField
New Contributor

This may or may not be helpful, but the same thing happened to me. I used Survey123 for my attachments, but it still wouldn't work. 

0 Kudos
BillSchlatter
Regular Contributor

Did you ever find a workaround?  

I found this working example in the wild from the City of Dallas: https://dallasgis.maps.arcgis.com/apps/instant/attachmentviewer/index.html?appid=93ed5abe933d4eb1bf0... 

Looking at the webmap that feeds it (https://semcog.maps.arcgis.com/home/webmap/viewer.html?webmap=ab97b957fa084484835cfcab0925f5b3), it seems like they had to create an Arcade expression to format links differently from however attachments do them by default.  It's still using images attached to the feature service, but the URL is built from values stored in the feature table, which looks like it would be a ton of manual work to set up.  

0 Kudos
BillSchlatter
Regular Contributor

I did some more digging, and found a workaround. 

The important details: Esri is aware that the Attachment Viewer app in ArcGIS Online is basically broken at the moment.  The don't have a timeline for fixing it, but you can get around it if you can host the code on your own server.  

The workaround: Download the source code from Github (https://github.com/Esri/attachment-viewer).  Copy your AGO app's App ID into the quote marks on the "appid" line in dist\config\application.json and save the file.  Copy the contents of the dist folder to your web server, and it should work.  

The bug documentation: https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEzNzI4MQ== 

From what I can see, it looks like the issue is that the latest version of the Attachment Viewer app is broken on AGO.  The Github version seems to have been rolled back to an earlier version that actually works, but for whatever reason, they didn't do the same with the default code used by AGO.  I'm making a few assumptions that may not be safe, but that's the best guess I have for what's going on.  

0 Kudos
RyanLibed
Esri Contributor

Hi Bill,

Just to follow up, it appears that your test sample app is now loading attachments. 

https://semcog.maps.arcgis.com/apps/instant/attachmentviewer/index.html?appid=9b5d26ab4f80430782584f...

Please let us know if you see anymore issues. 

 

Thanks,
Ryan

0 Kudos
RyanLibed
Esri Contributor

Hi Bill, 

Thank you for this post! I took a closer look at the app code and found that there is some app logic that once worked with a previous version of the 4.x ArcGIS API for JavaScript, but no longer does. This issue will be addressed and your app should be able to load attachments tomorrow night, once the June 2021 ArcGIS Online update takes place. 

Thanks again for reporting this!

0 Kudos
by Anonymous User
Not applicable

@RyanLibed we're still seeing this error. The Web Map has two hosted Feature Layers with attachments enabled and present in the ArcGIS Online data table but we're still seeing this error.

Error appearing in Attachment Viewer:

mpc_1-1642555907265.png

Attachments enabled in ArcGIS Online:

mpc_0-1642555814188.png

mpc_2-1642556474857.png

This post Re: Attachment Viewer app - Esri Community suggests the attachments have to be on the feature table. Does this mean the Attachment Viewer won't work with hosted feature layers which have had attachments enabled from within ArcGIS Online?

RyanLibed
Esri Contributor

Hi @Anonymous User,

Based on the 'Data requirements' section in Attachment Viewer's item details page here: https://www.arcgis.com/home/item.html?id=65dd2fa3369649529b2c5939333977a1.

This web app includes the capability to view attachments of a hosted feature service or an ArcGIS Server feature service (10.8 or greater). Currently the attachment viewer will display jpeg, jpg, png, gif, mp4, mov, quicktime, pdf in the viewer window. All other attachment types are displayed as a link.
This means that you need to have 'Enable Attachments' checked; and, have your attachments on either a hosted feature service or an ArcGIS Server feature service of version 10.8 or greater. 

If both of these conditions are true on your side, would you happen to have a sample link that you'd be able to share to further troubleshoot the issue?

Thank you,
Ryan Libed
 





0 Kudos
by Anonymous User
Not applicable

Thanks Ryan. It's an ArcGIS Online Hosted Feature Layer with Attachments enabled so I think it meets the data requirements. It's not a public layer so I'll need your username to invite you to the Group.

RyanLibed
Esri Contributor

@Anonymous User can you add this username: RLibed_jsapi

Thanks,
Ryan

0 Kudos