Labels On Web Map Shows Domain Codes instead of Domain Value

2373
6
Jump to solution
03-30-2021 08:39 AM
sayamshivakumar
New Contributor II

Hi,

I have a requirement to show the labels in ArcGIS Collector app and Portal Web Maps.

I have a published a Feature Service by Configuring the below label expression which is working fine in ArcGIS Pro Desktop. but after publishing to ArcGIS Server, The web map is showing the Domain Codes instead of Domain Description in Portal web maps and in ArcGIS Collector App. 

code I'm using for label:   DomainName($feature, 'Diameter') + "-" + DomainName($feature, 'Material').

Any Quick help is much appreciated,

Thank You in Advance. 

0 Kudos
1 Solution

Accepted Solutions
ScottBaum1
New Contributor II

Whatever happened with this?  I am experiencing the same problem.

View solution in original post

6 Replies
Jelle_Stu_PR
Occasional Contributor II

What version of ArcGIS Server are you using? The DomainName() function was introduced with arcade 1.7. Version 1.7 can be used for ArcGIS Enterprise 10.7.1 (2019) and up. See version matrix here. 

0 Kudos
sayamshivakumar
New Contributor II

we are using, 10.8.1 ArcGIS server

0 Kudos
ScottBaum1
New Contributor II

Whatever happened with this?  I am experiencing the same problem.

sayamshivakumar
New Contributor II

If you're using any subtypes.
Assign the default domain.

We have assigned the default domain, this has resolved the issue. 

ScottBaum1
New Contributor II

That was the clue I needed.  It took some time to figure out, but I changed my code from DomainName($feature, 'diameter') to DomainName($feature, 'diameter', $feature.diameter, $feature.assetgroup) and that worked.

sayamshivakumar
New Contributor II

Kudos @ScottBaum1 👍

0 Kudos