Hello all,
I would like to return the number of attachments in a related table.
Is this possible?
I know how to count he number of related records, and I know
var relatedrecords = FeatureSetByRelationshipName($feature, "MonitoringPhotoSites")
var cnt = Count(relatedrecords);
return cnt;
And I know how to count the attachments in the feature
Count(Attachments($feature)
But I'm not quite sure how to combine those two together. Has anyone an idea?
Cheers,
Marco
Solved! Go to Solution.
Something like this?
var related_records = FeatureSetByRelationshipName($feature, "MonitoringPhotoSites")
var cnt = 0
for(var rr in related_records) {
cnt += Count(Attachments(rr))
}
return cnt
Something like this?
var related_records = FeatureSetByRelationshipName($feature, "MonitoringPhotoSites")
var cnt = 0
for(var rr in related_records) {
cnt += Count(Attachments(rr))
}
return cnt
Yep, thats it. Not sure what I did wrong. I tried a for loop, but it seems that I missed something...
Anyway, thanks Johannes!