Hi @jcarlson,
thanks a lot for your help.
The way with the DomainName() function is exactly what I am trying now:
var portal = Portal('https://www.arcgis.com');
var itemId = '???';
var layerId = 1;
var fs = GroupBy(
Filter(
FeatureSetByPortalItem(portal, itemId, layerId, ['ACCOUNT_MANAGER', 'REGION'], false),
'ACCOUNT_MANAGER > 0'),
['ACCOUNT_MANAGER'],
[
{ name: 'COUNT_REGIONS', expression: 'REGION', statistic: 'COUNT' },
]);
var dict = {
'fields': [
{ 'name': 'ACCOUNT_MANAGER', 'type': 'esriFieldTypeString' },
{ 'name': 'COUNT_REGIONS', 'type': 'esriFieldTypeInteger' },
],
'geometryType': '',
'features': []
};
var index = 0;
for (var f in fs) {
dict.features[index] = {
'attributes': {
'ACCOUNT_MANAGER': DomainName(f, 'ACCOUNT_MANAGER'),
'COUNT_REGIONS': f['COUNT_REGIONS'],
},
};
index++;
}
return FeatureSet(Text(dict));
But this seems to doesn't work in my sample 😞
Additionally I tested the following:
var fs = FeatureSetByPortalItem(...);
Console("ACCOUNT_MANAGER:");
for (var f in fs) {
var d = DomainName(f, "ACCOUNT_MANAGER");
Console(d);
}
and I only get the numeric values and NOT the names represented by the domain!
ACCOUNT_MANAGER:
4
2
2
4
4
.
.
.
Do you have any idea what's wrong?
The names are still in the layer, because if I open the table inside the Map Viewer I will see it ...
Some note: Could it be a problem that the table which includes the ACCOUNT_MANAGER has a subtype?
Regards,
Daniel.