<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Access coded domain values in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/access-coded-domain-values/m-p/1569436#M13180</link>
    <description>&lt;P&gt;Something like this should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private static string GetDisplayValue(Field field, Feature feature)
{
    if (field is null || feature is null || !feature.Attributes.ContainsKey(field.Name))
        return string.Empty;
    var value = feature.Attributes[field.Name];
    if (field.Domain is CodedValueDomain cvd)
    {
        value = cvd.CodedValues.FirstOrDefault(c =&amp;gt; c.Code == value)?.Name ?? value;
    }
    return value?.ToString() ?? string.Empty;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2024 18:03:09 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2024-12-17T18:03:09Z</dc:date>
    <item>
      <title>Access coded domain values</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/access-coded-domain-values/m-p/1563656#M13151</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;I am loading the data from a mobile geodatabase, which includes the Utility Network.&lt;/P&gt;&lt;P&gt;I can see the geodatabase contain the field domains. However, I'd like to display the field domain value description, instead of the code in a popup.&lt;/P&gt;&lt;P&gt;Any suggestions ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 08:34:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/access-coded-domain-values/m-p/1563656#M13151</guid>
      <dc:creator>RavinHasseea</dc:creator>
      <dc:date>2024-12-11T08:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Access coded domain values</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/access-coded-domain-values/m-p/1569436#M13180</link>
      <description>&lt;P&gt;Something like this should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private static string GetDisplayValue(Field field, Feature feature)
{
    if (field is null || feature is null || !feature.Attributes.ContainsKey(field.Name))
        return string.Empty;
    var value = feature.Attributes[field.Name];
    if (field.Domain is CodedValueDomain cvd)
    {
        value = cvd.CodedValues.FirstOrDefault(c =&amp;gt; c.Code == value)?.Name ?? value;
    }
    return value?.ToString() ?? string.Empty;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 18:03:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/access-coded-domain-values/m-p/1569436#M13180</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2024-12-17T18:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Access coded domain values</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/access-coded-domain-values/m-p/1570528#M13205</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1052"&gt;@dotMorten_esri&lt;/a&gt;&amp;nbsp;.&amp;nbsp; This should work, but unfortunately it doesn't.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;cvd.CodedValues.FirstOrDefault(c =&amp;gt; c.Code == value)?.Name ?? value;&lt;/PRE&gt;&lt;P&gt;Still gives me the code, instead of the name. I can see the name is populated when debugging.&lt;/P&gt;&lt;P&gt;Also I need to include Asset Group and Asset Types description.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 10:34:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/access-coded-domain-values/m-p/1570528#M13205</guid>
      <dc:creator>RavinHasseea</dc:creator>
      <dc:date>2024-12-20T10:34:52Z</dc:date>
    </item>
  </channel>
</rss>

