I am trying to set up an arcade expression in the layer symbology that will differentiate features with and without attachments. The Count(Attachments($feature)) part works great in a popup attribute expression and returns the necessary values but I am getting an error when trying to use the same code in the symbology expression. It is saying 'Attachments' is not defined.
Here's my code:
If(Count(Attachments($feature)) > 0) {
// if count is greater than zero there are attachments
return 'Has Attachments'
} else {
// otherwise the feature has been inspected but missing photos
return 'No Attachments'
}
The funny part is, if I click run to test, it gives me the correct output but the Done button is grayed out.
I'm seeing the same thing in Map Viewer on a layer with attachments enabled. I'd recommend opening a tech support ticket to get this addressed.
Based on what I'm seeing in the blog post below, it appears using Attachments() for symbology did work at one point in Map Viewer Classic but it no longer seems to work there either (returns "attachments is not available").
Thank you for the feedback! I'll submit a ticket