ArcGIS Online custom attribute display showing Domain Codes not Domain Descriptions

174
11
06-30-2022 04:24 AM
Labels (2)
OliverIshmael
New Contributor III

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?

0 Kudos
11 Replies
RussellRoberts1
Esri Frequent Contributor

Can you share the layer and map? Is this in an app or in map viewer classic or the latest map viewer?

0 Kudos
KenBuja
MVP Honored Contributor

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?

0 Kudos
OliverIshmael
New Contributor III

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.

Error during inviteError during invite

0 Kudos
RussellRoberts1
Esri Frequent Contributor

user name for me is russell_jsapi

0 Kudos
KenBuja
MVP Honored Contributor

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.

domain4.png

0 Kudos
OliverIshmael
New Contributor III

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 @RussellRoberts1 to a Group folder in which I have shared my content, so hopefully you can take another look.

0 Kudos
RussellRoberts1
Esri Frequent Contributor

What layer are you trying to use? 

0 Kudos
OliverIshmael
New Contributor III

Recent_Furniture_Inspections_v7_1_(Not_a_View)

0 Kudos
RussellRoberts1
Esri Frequent Contributor

When looking at the REST endpoint for that service I dont see any domains defined on the fields. 

0 Kudos