<?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: Custom Expression Label in ArcGIS Online in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/custom-expression-label-in-arcgis-online/m-p/1046632#M39439</link>
    <description>&lt;P&gt;When using an If statement, you have to use "==" to compare two values.&amp;nbsp; You also have to use "||" when doing a &lt;EM&gt;this&lt;/EM&gt; or &lt;EM&gt;that &lt;/EM&gt;comparison. Finally, the code for "Other" goes inside the DomainName function. Your code should look like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if ( DomainName($feature,"REVIEW_STATUS") == 1 || DomainName($feature,"REVIEW_STATUS") == 3) {
    return DomainName($feature,"TASS_REVIEW_STATUS", "Other")
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Apr 2021 20:49:54 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2021-04-13T20:49:54Z</dc:date>
    <item>
      <title>Custom Expression Label in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/custom-expression-label-in-arcgis-online/m-p/1046568#M39436</link>
      <description>&lt;P&gt;I know I'm close.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If (DomainName($feature,"REVIEW_STATUS") = 1 or 3) then {return DomainName($feature,"TASS_REVIEW_STATUS")} = "Other")&lt;/P&gt;&lt;P&gt;I"m trying to have it label where If the Review Status is 1 or 3 then TASS Review Status = Other&lt;/P&gt;&lt;P&gt;1 and 3 are domains of review status and Other is a domain in the TASS Review Status field&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 19:28:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/custom-expression-label-in-arcgis-online/m-p/1046568#M39436</guid>
      <dc:creator>MCouden</dc:creator>
      <dc:date>2021-04-13T19:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Expression Label in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/custom-expression-label-in-arcgis-online/m-p/1046632#M39439</link>
      <description>&lt;P&gt;When using an If statement, you have to use "==" to compare two values.&amp;nbsp; You also have to use "||" when doing a &lt;EM&gt;this&lt;/EM&gt; or &lt;EM&gt;that &lt;/EM&gt;comparison. Finally, the code for "Other" goes inside the DomainName function. Your code should look like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if ( DomainName($feature,"REVIEW_STATUS") == 1 || DomainName($feature,"REVIEW_STATUS") == 3) {
    return DomainName($feature,"TASS_REVIEW_STATUS", "Other")
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 20:49:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/custom-expression-label-in-arcgis-online/m-p/1046632#M39439</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-04-13T20:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Expression Label in ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/custom-expression-label-in-arcgis-online/m-p/1049110#M39584</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/463830"&gt;@MCouden&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Values 1 and 3 do not sound like domain descriptions to me. I suppose they are the actual code values stored in the field. If that is the case you can do something like this:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;if (Includes([1, 3], $feature["REVIEW_STATUS"])) {
    return "Other";
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I used the more or less new Includes function to shorten the validation and I am testing to the value stored in the field (the code in the domain). You may also want to include an else statement since otherwise, you will only see "Other" and nothing. Maybe something like this:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;if (Includes([1, 3], $feature["REVIEW_STATUS"])) {
    return "Other";
} else {
    return DomainName($feature, "REVIEW_STATUS");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example, I return the text "Other" and not the description that corresponds to a code "other" from the domain you mentioned and Ken showed in his solution. If you need the description rather than the text "Other" you should use Ken's solution.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 14:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/custom-expression-label-in-arcgis-online/m-p/1049110#M39584</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-04-20T14:00:46Z</dc:date>
    </item>
  </channel>
</rss>

