Select to view content in your preferred language

Show Attachment Count per Record in Dashboard List

270
2
02-03-2025 07:55 PM
Labels (1)
JustinWolff
Regular Contributor

I've discovered the hard way that the Arcade function Count(Attachments($feature)) cannot be used in a Field Maps Calculated Expression to automatically update and return a count of the attachments, because the attachments can't be counted until the record is submitted.  Fine.  Is there a way to display the number of attachments per record in a Dashboard List?  I cannot figure out how to make this work.  I'm doing all of this in AGO using hosted data.

Any chance @jcarlson has done something like this? 

Thanks 

0 Kudos
2 Replies
AndreasHall
Esri Regular Contributor

I do not know exactly how but you could try to use arcade in the list element to count the number of attachments per record. Perhaps Count(Attachments($feature)) will work?

0 Kudos
JustinWolff
Regular Contributor

Thanks @AndreasHall - I've have an indicator to give me total attachments (see below), but I just need a list with a count for every feature/record.  I'm drawing a blank today...

 

var portal = Portal('https://------.maps.arcgis.com');
var assets = FeatureSetByPortalItem(
    portal,
    'item_id',
    0,
    ['*'],
    false
)

var photo_count = 0

for(var feat in assets){
  photo_count += Count(Attachments(feat))
}
return photo_count

   

0 Kudos