I have a dashboard where I am inserting an indicator. My indicator is looking at a layer and is working fine. I want to edit my reference layer to combine some data from two different layers. I am using the data expression option to create some arcade code to return the value that I want. I have gotten it to work in the arcade editor, but when I save the code and try to make it my reference layer it says "Unable to execute Arcade Script."
The layers that I am trying to reference are part of a layer group. But it seems to work fine when it is in the editor and grabs the right data.
Any ideas on what I can try?
Solved! Go to Solution.
A Data Expression needs to return a FeatureSet, not a variable. Replace line 11 with this
var theDict = {
'fields': [{ 'name': 'result', 'type': 'esriFieldTypeInteger'}],
'geometryType': '',
'features': [
{
'attributes': {
'result': Text(Round(fiber_total),'#,####')
}
}
]
};
return FeatureSet(theDict);
A Data Expression needs to return a FeatureSet, not a variable. Replace line 11 with this
var theDict = {
'fields': [{ 'name': 'result', 'type': 'esriFieldTypeInteger'}],
'geometryType': '',
'features': [
{
'attributes': {
'result': Text(Round(fiber_total),'#,####')
}
}
]
};
return FeatureSet(theDict);
@KenBuja Thank you that worked! I did have to get rid of the Text() function cause it seemed to be returning the number of characters. Once I did that it did give me my value that I wanted!