I am trying to set up pop ups of environmental data which uses the label in the domain rather than the code value. At the moment I have been setting up the pop ups using else if statements.
e.g.
var Type = $feature.lifestage;
if (Type == 'A') {Type = 'adult';}
else if (Type == 'Lva') {Type = 'larvae';}
else if (Type == 'E') {Type = 'egg';}
return Type;
However I need to do the same thing for species data using a domain of plant lists which is several thousand rows long so can't use the same code as above. I'm sure there must be a simple solution that I am hoping someone can share with me. Example subset of domain is below.
CODE | DESC |
NBNSYS0200001285 | Abelia |
NBNSYS0000139224 | Abies (Firs) |
NHMSYS0000455513 | Abies alba (European Silver-fir) |
NBNSYS0000042419 | Abies amabilis |
BMF | Abies bornmuelleriana (Trojan Fir) |
NBNSYS0000034340 | Abies cephalonica (Greek Fir) |
NHMSYS0021109850 | Abies fraseri (Fraser Fir) |
NHMSYS0000455520 | Abies grandis (Giant Fir) |
NBNSYS0000034011 | Abies nordmanniana (Caucasian Fir) |
NBNSYS0000140832 | Abies procera (Noble Fir) |
NBNSYS0000139234 | Abutilon |
NHMSYS0100000348 | Abutilon theophrasti (Velvetleaf) |
NBNSYS0000139235 | Acacia (Australian Blackwood) |
NHMSYS0000455529 | Acacia melanoxylon (Australian Blackwood) |
NBNSYS0000139236 | Acaena |
NBNSYS0000003391 | Acaena anserinifolia (Bronze Pirri-pirri-bur) |
NBNSYS0000014912 | Acaena anserinifolia x inermis (Pirri-Pirri-Bur) |
Solved! Go to Solution.
You can use Arcade and DomainName to get the Label or Description for the domain.
mark
You can use Arcade and DomainName to get the Label or Description for the domain.
mark
Is this actually a domain on the field itself? As @MarkBockenhauer notes, the DomainName function is exactly what you want.
If the values are maintained in some other table, there might still be a way to do it.