I have used the data expression below for an Indicator in my dashboard to sum fields across layers. the Indicator works fine, but as soon as I enable Map Actions for that Indicator, the Indicator stops working.
Any ideas on how to resolve the issue?
var portal = Portal('https://www.arcgis.com/');
// p1
var p1 = FeatureSetByPortalItem(portal,'4b8fd0f3453a447684f3f3db69bdc935',0,['OBJECTID'],true);
var p1_Count = COUNT(p1);
// p2
var p2 = FeatureSetByPortalItem(portal,'4b8fd0f3453a447684f3f3db69bdc935',1,['OBJECTID'],true);
var p2_Count = COUNT(p2);
// p3
var p3 = FeatureSetByPortalItem(portal,'4b8fd0f3453a447684f3f3db69bdc935',2,['OBJECTID'],true);
var p3_Count = COUNT(p3);
// Total number
var total = p1_Count + p2_Count + p3_Count
// create data schema
var dict = {
'fields': [
{'name': 'number', 'type': 'esriFieldTypeInteger'}],
'geometryType': 'esriGeometryPoint',
'features': []};
// fill the data schema with the data
dict.features[0] = {
'attributes': {
'number': total
},
geometry: Geometry(dict)
};
// return the featureset
return FeatureSet(Text(dict));
