GroupBy returns Domain Codes - how to get Domain Names?

445
1
01-21-2022 04:32 PM
Labels (1)
Wolfgang_Grunberg_AZ_DFFM
New Contributor III

Data Expressions for Dashboard's List widget is a joy!

The following code works well but only returns Domain Codes.

Can DomainName($feature, 'Trap_Region') somehow be used to get Domain Names?

var portal = Portal('https://www.arcgis.com/');
var fs = FeatureSetByPortalItem( 
    portal, 'XXXXXXXXXXXXXXXXXXXXXXX', 
    1, 
    ['Trap_ID','Trap_Region'], 
    false
);

// Trap count grouped by trap region
var fs_gp = GroupBy(fs, ['Trap_Region'], [{name: 'Total_Traps', expression: 'Trap_ID', statistic: 'COUNT' }]);

return fs_gp

 

1 Reply
HMarcks
New Contributor III

Thanks for the code, it worked great for me.  I was not able to figure out how to get the domain names either but I did find in the dashboard editor (under slices for pie chart) that you could change the label for the categories manually.  Hope that helps. 

 

Dashboard Chart.PNG

0 Kudos