Arcade Expression for Dashboard List from multiple feature services

08-16-2021 10:15 AM
Labels (1)
New Contributor II

I am working on a Catch Basin Monitoring dashboard.  The dashboard needs to summarise activities by watershed.  I would like to create ONE simple list that has the following summaries:

  1. Watershed name,
  2. Total Catch Basins,
  3. Catch basins Inspected
  4. Total Manhours
  5. Total Sediment removed

Using the "groupby" command as described in this article, I can generate a COUNT by watershed.  The trouble is, each of my metrics to report (items 2 - 5 from list above) are within seperate FS's, with Watershed being common.  Can I nest, or use multiple returns?

Any hints on how to achieve this are greatly appreciated.





0 Kudos
1 Reply
New Contributor II

One thought I am having, can I generate a separate list of each metric by watershed and then join them together to create one RETURN.  The code below seems to work in the experssion test, but not full excecuted:


var Cleanings = FeatureSetByPortalItem(Portal(''),
0, ['Watershed','FeatureID','Cleaned','CleaningDate'], false);
var Total = FeatureSetByPortalItem(Portal(''),
0, ['Watershed','FeatureID'], false);

Var Clean = GroupBy(Cleanings, ['Watershed'], [
{name: 'Cleaned', expression: 'Cleaned', statistic: 'COUNT' }]);

Var Total = GroupBy(Total, ['Watershed'], [
{name: 'total_sites', expression: 'FeatureID', statistic: 'COUNT' }

Return {Clean, Total}

Can I join by attribute Clean and Total and return just the joined table?

0 Kudos