I am using the Attachment Viewer Instant App to share point feature locations and attached site photos. There use to be an option to "Hide Features without Attachments" so that you only see sites with photos, but I can no longer find this option in the app set up.
This blog refers to the fact that this option exists, but I can not find the option in my set up (see attached screen shot that shows the options in my "Interactivity">"Modify" and the fact that empty attachment squares are being displayed in my app).
Am I missing something?
The setting you are recalling is the 'Only display features with attachments' setting and is a setting that has been deprecated since the June 2021 ArcGIS Online update. However, here is a workaround that can help:
1. Create a new field in your layer.
2. Use an arcade expression to calculate the field using this attachments data function
3. In the arcade expression, write an if statement to check if there are attachments; and if so, return a value to determine that there are attachments i.e. "Yes", and if there aren't any, return a value that determines that there aren't attahcments i.e. "None".
4. Add a filter to the map based on the values created.
// Create a field that shows how many attachments to filter on
var stands = $feature
var featAttach = Count(Attachments(stands))
// Value that will be returned if there are attachments present
var yes = "Yes"
// Value that will be returned if there are no attachments present
var none = "None"
IIf(featAttach > 0, yes, none)
We will plan to get the information in the blog updated and we'll also work on getting this workaround documented.
Thanks for using Attachment Viewer! Please let me know if you have further questions.
Thanks for this update, Ryan.
This workaround will do for now, but the functionality of being able to remove from the Attachment Viewer any sites without an attachment was a very useful part of that tool.
Do you have any recommendations for ways to automate the attachment field calculation, or do I manually have to go in regularly to update this? I am working with live data that is constantly getting updated, which is why I appreciated the functionality of automatically removing using the previously available setting.
I think the workaround would require a manual update. The setting has been deprecated due to performance taking a hit when enabled, however, we are looking into an alternate approach on hiding feature without attachments, out of the box, through a lightweight operation. I will post any updates here.