<?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: Arcade custom symbology in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1535608#M61370</link>
    <description>&lt;P&gt;You need to check the values of the fields based on the &lt;STRONG&gt;domain &lt;/STRONG&gt;&lt;STRONG&gt;code&lt;/STRONG&gt;, not the domain name. I'm assuming the value "In Progress" might be stored as "in_progress" or something like that? You'd need to check &lt;STRONG&gt;if(reviewStatus == 'in_progress') &lt;/STRONG&gt;if that's the case.&lt;/P&gt;&lt;P&gt;To check against the description itself, you need to use DomainName($feature, 'reviewStatus') to pull the text name.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2024 18:04:03 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2024-09-05T18:04:03Z</dc:date>
    <item>
      <title>Arcade custom symbology</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1358577#M56321</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Based on the sample data how can I create a&amp;nbsp;&lt;/SPAN&gt;new column/variable&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;A&amp;amp;B&lt;SPAN&gt;, based on when&amp;nbsp;&lt;/SPAN&gt;certain conditions&lt;SPAN&gt;&amp;nbsp;are met from two columns using&amp;nbsp;&lt;/SPAN&gt;Arcade&lt;SPAN&gt;&amp;nbsp;and then assign colors to the new column's categorical values accordingly?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am using&amp;nbsp;Pro 3.1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;ID A       B       A&amp;amp;B
1  Present Present A Present &amp;amp; B Present 
2  Absent  Present A Absent  &amp;amp; B Present
3  Present Absent  A Present &amp;amp; B Absent
4  Absent  Absent  A Absent  &amp;amp; B Absent
5  Present Present A Present &amp;amp; B Present 
6  Absent  Present A Absent  &amp;amp; B Present
7  Present Absent  A Present &amp;amp; B Absent
8  Absent  Absent  A Absent  &amp;amp; B Absent&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Color conditions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;A Present &amp;amp; B Present&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;then color&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;red.&lt;/LI&gt;&lt;LI&gt;If&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;A Absent &amp;amp; B Present&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;A Present &amp;amp; B Absent&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;then color&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;orange.&lt;/LI&gt;&lt;LI&gt;If&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;A Absent &amp;amp; B Absent&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;then color&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;yellow.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 08 Dec 2023 15:45:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1358577#M56321</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2023-12-08T15:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade custom symbology</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1358597#M56322</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;happy Friday, hope all is well, when you have the time, can you please have a look into this? Cheers!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 15:50:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1358597#M56322</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2023-12-08T15:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade custom symbology</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1358599#M56323</link>
      <description>&lt;P&gt;You don't necessarily need to calculate a whole new field for this, but you could. Whether you calculate the field or use this expression directly in the symbology settings, it is the same.&lt;/P&gt;&lt;P&gt;This is simple enough in Arcade. Note, however, that the expression won't directly set the color. Rather, it will return a value that your symbology settings will use for categories. You can call them 'red', 'orange', and 'yellow', but they may as well be 'a', 'b', and 'c' for all the different it makes. Colors are set separately from the expression.&lt;/P&gt;&lt;P&gt;Here are your color conditions in Arcade&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return when(
  $feature.A == 'Present' &amp;amp;&amp;amp; $feature.B == 'Present', 'red',
  ($feature.A == 'Absent' &amp;amp;&amp;amp; $feature.B == 'Present') || ($feature.A == 'Present' &amp;amp;&amp;amp; $feature.B == 'Absent'), 'orange',
  $feature.A == 'Absent' &amp;amp;&amp;amp; $feature.B == 'Absent', 'yellow',
  'other'
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you don't really need all this. Since it doesn't matter &lt;EM&gt;which &lt;/EM&gt;value is absent/present, just the &lt;EM&gt;count&lt;/EM&gt;, we can simplify matters.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// this will create a 2-item array of either True or False
var present = [
  $feature.A == 'Present',
  $feature.B == 'Present'
]

return when(
  All(present), 'red',    // matches when both are 'Present'
  Any(present), 'orange', // matches when either are 'Present', but only evaluates if the first check is false; in other words, when only 1 is 'Present'
  'yellow' // logically anything else will be when both are 'Absent', so we don't actually need any conditions
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 15:57:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1358599#M56323</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-12-08T15:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade custom symbology</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1535604#M61369</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/554773"&gt;@Ed_&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;, hoping I can get some insight from you both on a similar issue.&lt;/P&gt;&lt;P&gt;I have a field named "Status" that has about six or seven values defined by a domain. I would like to categorize these values into a smaller number of values using Arcade and then use those three values for defining the symbology.&lt;/P&gt;&lt;P&gt;When I use the code on a field that does not have a domain applied, I use&amp;nbsp;var reviewStatus = $feature.reviewstatus and it works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I attempt to use the code below on a field that DOES have domain applied, all items return as Complete. However, I can look in the data and see some values that are Needs Review or Pending.&lt;BR /&gt;&lt;BR /&gt;Here's what I have:&lt;/P&gt;&lt;P&gt;var reviewStatus = DomainName($feature,"reviewstatus")&lt;/P&gt;&lt;P&gt;if (reviewStatus == "")&lt;BR /&gt;{&lt;BR /&gt;return "Needs Review"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (IsEmpty(reviewStatus))&lt;BR /&gt;{&lt;BR /&gt;return "Needs Review"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (reviewStatus == "Avoid")&lt;BR /&gt;{&lt;BR /&gt;return "Needs Review"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (reviewStatus == "High Priority")&lt;BR /&gt;{&lt;BR /&gt;return "Needs Review"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (reviewStatus == "In Progress")&lt;BR /&gt;{&lt;BR /&gt;return "Needs Review"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (reviewStatus == "Needs Review")&lt;BR /&gt;{&lt;BR /&gt;return "Needs Review"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (reviewStatus == "Pending")&lt;BR /&gt;{&lt;BR /&gt;return "Pending"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;else&lt;BR /&gt;{&lt;BR /&gt;return "Complete"&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 17:58:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1535604#M61369</guid>
      <dc:creator>KatClifton</dc:creator>
      <dc:date>2024-09-05T17:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade custom symbology</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1535608#M61370</link>
      <description>&lt;P&gt;You need to check the values of the fields based on the &lt;STRONG&gt;domain &lt;/STRONG&gt;&lt;STRONG&gt;code&lt;/STRONG&gt;, not the domain name. I'm assuming the value "In Progress" might be stored as "in_progress" or something like that? You'd need to check &lt;STRONG&gt;if(reviewStatus == 'in_progress') &lt;/STRONG&gt;if that's the case.&lt;/P&gt;&lt;P&gt;To check against the description itself, you need to use DomainName($feature, 'reviewStatus') to pull the text name.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 18:04:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1535608#M61370</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-09-05T18:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade custom symbology</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1535639#M61372</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;, thanks for your prompt reply! Just looked at the domain code, and I see that one of the values is truncated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I will update my Arcade code to refer to the domain code (not the name) and update the Arcade to consider the truncated values in the code field.&lt;/P&gt;&lt;P&gt;Much appreciated!!!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 19:07:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-custom-symbology/m-p/1535639#M61372</guid>
      <dc:creator>KatClifton</dc:creator>
      <dc:date>2024-09-05T19:07:01Z</dc:date>
    </item>
  </channel>
</rss>

