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

577
5
Jump to solution
06-14-2021 07:22 AM
BillSchlatter
Occasional 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
Occasional 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
5 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
Occasional 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
Occasional 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
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