My feature class has Coded Value Domains defined and I have configured popups in ArcGIS Online to display custom attributes. While this works, it is displaying the Domain Codes not the Domain Descriptions.
How can I fix this?
Can you share the layer and map? Is this in an app or in map viewer classic or the latest map viewer?
How are you configuring your popup? Are you using Arcade in Attribute Expressions? Are you using the DomainName function to return the domain rather than the code?
Using Map Viewer Classic I have configured the pop up using 'a custom attribute display'. This is on a layer that was created by way of an Analysis join (and not saved as Hosted Feature Layer View - because I intend to use it in an offline environment):
Facility: {Location_Facility}
Asset Type: {AssetType}
Asset Description: {Asset_Description}
Description of Asset defined as 'Other': {Asset_Other_Description}
Level of Inspection: {InspectionLevel}
Inspection Frequency: {Inspection_Frequency}
Justification for Inspection Frequency: {Frequency_Justification}
Inspection Date: {InspectionDate}
Inspector: {Inspector}
Asset Condition: {Condition}
Condition Comments: {Comments}
Date Resolved: {ResolvedDate}
Resolution Comments: {ResolutionComments}
I tried to implement the DomainName function in an Arcade expression, for the Condition value above...DomainName($layer, Condition) but this results in an error:
Execution Error:Runtime Error: Identifier Not Found. Condition
I tried to share the content with you both in a Group; RussellRoberts1 was not found, but for KenBuja I got this error message.
user name for me is russell_jsapi
Doing a quick test on an Analysis layer, it looks like the Domain information is not carried over from the original layer to the Analysis layer. I was trying to see whether I could load the domain from the original layer, but that wasn't working either.
As for just putting the DomainName function directly into the Custom Attribute Display (CAD), it doesn't work like that. You first create an expression in the Attribute Expressions section and then use that expression is the CAD.
I didn't try putting the Domain Name function directly in the CAD, but went via the Attribute expressions section, so unfortunately it wasn't that.
On the plus side, I have been able to add @RussRoberts to a Group folder in which I have shared my content, so hopefully you can take another look.
What layer are you trying to use?
Recent_Furniture_Inspections_v7_1_(Not_a_View)
When looking at the REST endpoint for that service I dont see any domains defined on the fields.