Hi
I am using arcade code to count attachments and save in field, but
Count(Attachments(item));
but I get the following error:
invalid arcade expression, arcade error: expected attachment type, script line: 4
I'm using ArCGIS pro 2.9.11 and enterprise 2.9.1
My attribute rule:
var features = FeatureSetByName($datastore,'FeatureClass', ['*'], false);
var gid=$feature.REL_GLOBALID;
var item=First(Filter(features, 'globalid = @gid'));
var count = Count(Attachments(item));
if ($editcontext.editType == 'DELETE'){
var count_total=count-1
} else {
var count_total=count
}
return {
'edit': [{
'classname' : 'FeatureClass',
'updates' : [{
'globalid': gid,
'attributes' : {'Adjs' :count_total }
}]
}]
}
I have tried the same Count(Attachments()) line and it is valid arcade for calculated fields.
Thanks!