<?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: Conditional Symbology based on Script in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588684#M63773</link>
    <description>&lt;P&gt;Thanks for continuing to work on this,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;Unfortunately, the updated script gave only black points.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-24 111924.png" style="width: 705px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126148i84A98A32D0CC9FA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-24 111924.png" alt="Screenshot 2025-02-24 111924.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Feb 2025 19:20:23 GMT</pubDate>
    <dc:creator>JoseLGonzalez</dc:creator>
    <dc:date>2025-02-24T19:20:23Z</dc:date>
    <item>
      <title>Conditional Symbology based on Arcade Script?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588199#M63747</link>
      <description>&lt;P&gt;I'm trying to set up conditional symbology by turning the contents of the highlighted row, under the column “ALL_UNITS” into an array. So the array should contain the elements: E29, E64, E82, E244, and E286. Once the array is established, the script should check the column RedUnits for matches. Therefore, the points for STANUM 29 should have the “White Yellow” symbology.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-21 113709.png" style="width: 658px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126017i9B9181ABE9473211/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-21 113709.png" alt="Screenshot 2025-02-21 113709.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-21 113824.png" style="width: 658px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126018i0AAA5DBBB42B163D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-21 113824.png" alt="Screenshot 2025-02-21 113824.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;var st1102 = IIf($feature["STANUM"] == 1102, $feature["ALL_UNITS"], null);&lt;/P&gt;&lt;P&gt;var st1102array = Split(st1102, ",");&lt;/P&gt;&lt;P&gt;if (Includes(st1102array, $feature.RedUnits))&lt;/P&gt;&lt;P&gt;return "White Yellow";&lt;/P&gt;&lt;P&gt;else if ($feature.RedUnits == null &amp;amp;&amp;amp; $feature.GreenUnits == null &amp;amp;&amp;amp; $feature.BlueUnits != null)&lt;/P&gt;&lt;P&gt;return "Brown";&lt;/P&gt;&lt;P&gt;else if ($feature.RedUnits == null &amp;amp;&amp;amp; $feature.GreenUnits != null)&lt;/P&gt;&lt;P&gt;return "Grey";&lt;/P&gt;&lt;P&gt;else if ($feature.RedUnits != null)&lt;/P&gt;&lt;P&gt;return "White";&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;return "Black";&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 16:59:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588199#M63747</guid>
      <dc:creator>JoseLGonzalez</dc:creator>
      <dc:date>2025-02-26T16:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Symbology based on Script</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588239#M63748</link>
      <description>&lt;P&gt;One thing I see is that st1102array is ["E29"," E64"," E82"," E244"," E286"]. Note that there is a space before all of text elements except the first. This means that if RedUnits was "E64", it would return "White" instead of "White Yellow". You should use ", " instead of "," for the separator in the Split function.&lt;/P&gt;&lt;P&gt;The other thing I see is if there are two items in RedUnits (STATNUM&amp;nbsp; 33), it would return "White". You can split RedUnits into an array to check if any of them match.&lt;/P&gt;&lt;P&gt;This should work properly&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var st1102 = IIf($feature["STANUM"] == 1102, $feature["ALL_UNITS"], null);
var st1102array = Split(st1102, ", ");
var RedUnitsArray = Split($feature.RedUnits, ", ");

for (var i in RedUnitsArray) {
  if (Includes(st1102array, RedUnitsArray[i])) return "White Yellow";
}

if (
  $feature.RedUnits == null &amp;amp;&amp;amp;
  $feature.GreenUnits == null &amp;amp;&amp;amp;
  $feature.BlueUnits != null
)
  return "Brown";
else if ($feature.RedUnits == null &amp;amp;&amp;amp; $feature.GreenUnits != null)
  return "Grey";
else if ($feature.RedUnits != null) return "White";
else return "Black";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 21:36:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588239#M63748</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-02-21T21:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Symbology based on Script</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588251#M63750</link>
      <description>&lt;P&gt;Thanks so much for the reply&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;Your script yielded an interesting result, the only points that got the White Yellow symbology are three test points I created with null values in the RedUnits column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-21 140049.png" style="width: 516px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126051iE40977A533347196/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-21 140049.png" alt="Screenshot 2025-02-21 140049.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 22:06:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588251#M63750</guid>
      <dc:creator>JoseLGonzalez</dc:creator>
      <dc:date>2025-02-21T22:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Symbology based on Script</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588257#M63753</link>
      <description>&lt;P&gt;I was testing with dummy data and didn't include the IIf statement, which threw things off. Here's the testing code with an update in line 13 in this code (line 6 of the previous code)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var STANUM = 1102;
var ALL_UNITS = "E29, E64, E82, E244, E286"
var st1102 = IIf(STANUM == 1102, ALL_UNITS, null);

var RedUnits //= "E29"
var GreenUnits //= "Q30"
var BlueUnits //= "S32"

var st1102array = Split(st1102, ", ");
var RedUnitsArray = Split(RedUnits, ", ");
console(st1102array, RedUnitsArray)
for (var i in RedUnitsArray) {
  if (!IsEmpty(st1102) &amp;amp;&amp;amp; Includes(st1102array, RedUnitsArray[i])) return "White Yellow";
}

if (
  RedUnits == null &amp;amp;&amp;amp;
  GreenUnits == null &amp;amp;&amp;amp;
  BlueUnits != null
)
  return "Brown";
else if (RedUnits == null &amp;amp;&amp;amp; GreenUnits != null)
  return "Grey";
else if (RedUnits != null) return "White";
else return "Black";&lt;/LI-CODE&gt;&lt;P&gt;This allowed me to test different scenarios, like changing STATNUM and the units to verify that each of the returns work.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 22:33:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588257#M63753</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-02-21T22:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Symbology based on Script</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588684#M63773</link>
      <description>&lt;P&gt;Thanks for continuing to work on this,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;Unfortunately, the updated script gave only black points.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-02-24 111924.png" style="width: 705px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126148i84A98A32D0CC9FA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-02-24 111924.png" alt="Screenshot 2025-02-24 111924.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 19:20:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588684#M63773</guid>
      <dc:creator>JoseLGonzalez</dc:creator>
      <dc:date>2025-02-24T19:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Symbology based on Script</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588701#M63774</link>
      <description>&lt;P&gt;Unfortunately, without access to your data, there's not much more I can do. I made sure each of the possible combinations of variables in my test code would give the expected response. For example, changing this line&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var GreenUnits = "Q30"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;returns "Grey"&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2025 19:38:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1588701#M63774</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-02-24T19:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Symbology based on Script</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1589058#M63792</link>
      <description>&lt;P&gt;Copy that. I appreciate your efforts, Ken!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 18:09:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/conditional-symbology-based-on-arcade-script/m-p/1589058#M63792</guid>
      <dc:creator>JoseLGonzalez</dc:creator>
      <dc:date>2025-02-25T18:09:41Z</dc:date>
    </item>
  </channel>
</rss>

