Hello,
I'm hoping what I have is simple issue someone can see easier than me. I'm simply trying to aggregate trail names and sum their segment lengths to display in a dashboard list:
var portal = Portal('https://www.arcgis.com/');
var fs = FeatureSetByPortalItem(Portal,
'7b1fb95ab77f40bf8aa09c8b59045449',
0,
[
'TRLNAME',
'LengthMiles'
],
False //don’t include geometry
);
return GroupBy(fs, 'TRLNAME', { name: 'LengthMilesSum', expression: 'LengthMiles', statistic: 'SUM' });
The expression as is returns the error: Test execution error: Aggregation field not found. Verify test data.
I've tested enough to know that the error is in the group by function. Would love any help / tips.
Thanks!
Solved! Go to Solution.
There it is! You can see it in the URL:
sublayer=10
Change that to a 10 and it works!
When I look for that AGOL item, it's China prefecture demographics. Definitely no LengthMiles attribute on it.
Well that's embarrassing. Correct Item ID now returns: Test execution error: Unknown Error. Verify test data.
var portal = Portal('https://www.arcgis.com/');
var fs = FeatureSetByPortalItem(Portal,
'6a4eb769a1974476a3794a31054ddc63',
0,
[
'TRLNAME',
'LengthMiles'
],
False //don’t include geometry
);
return GroupBy(fs, 'TRLNAME', { name: 'LengthMilesSum', expression: 'LengthMiles', statistic: 'SUM' });
I don't have access to that particular item, but I see you're referencing Portal (with a capital p) after assigning the variable portal with a lower-case p. Can you change line 2 to use lower case and see what happens?
Just caught that error too - I shared the item publicly if that helps. Thanks!
There it is! You can see it in the URL:
sublayer=10
Change that to a 10 and it works!
Right! It's a feature set! TY!