Hello!
I am new to using arcade in dashboards and, hopefully, am making a simple mistake. I am trying to create an indicator from 2 different services (sum of Approved Dwelling Units). I am returning the correct value in the "Edit data expression" page but when I click done I am unable to use the expression - Esri says "Unable to execute script".
This is what my code currently looks like. This is my first time calculating values with different layers using FeatureSetByPortalItem
Code:
var PrelimPlans = FeatureSetByPortalItem(
Portal('https://www.arcgis.com/'),
'2a7c6c6f86b14253b1ecf079e3f4e6dd',
1,
['Name', 'APPR_DU_TOT', 'Count'],
false
);
//Count(PrelimPlans);
var PrelimDUTOT = Sum(PrelimPlans,'APPR_DU_TOT');
//Return PrelimDUTOT
var SitePlan = FeatureSetByPortalItem(
Portal('https://www.arcgis.com/'),
'33c2a66277c34153907ba5d14484a24b',
3,
['Name', 'APPR_DU_TOT', 'Count'],
false
);
//Count(SitePlan);
Sum(SitePlan,"APPR_DU_TOT")
var SitePlanDUTOT = Sum(SitePlan,'APPR_DU_TOT');
//Return SitePlanDUTOT
var CombinedDwellingUnits = PrelimDUTOT + SitePlanDUTOT;
Return CombinedDwellingUnits
***
Any help would be greatly appreciated!
All the best,
Colin