<?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: Symbolising using Arcade based on the values of 2 attributes, Arcade in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/symbolising-using-arcade-based-on-the-values-of-2/m-p/1183008#M46453</link>
    <description>&lt;P&gt;Perfect, thank you so much!&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 04:07:06 GMT</pubDate>
    <dc:creator>CourtneyWatson</dc:creator>
    <dc:date>2022-06-15T04:07:06Z</dc:date>
    <item>
      <title>Symbolising using Arcade based on the values of 2 attributes, Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/symbolising-using-arcade-based-on-the-values-of-2/m-p/1182997#M46451</link>
      <description>&lt;P&gt;Hi there, very new to the world of Arcade and i'm failing miserably it seems.&amp;nbsp; What I am trying to do is create 3 symbology levels 'Severe Danger', 'Medium Risk' and 'Low' based on 2 attribute fields.&amp;nbsp; riskrangehuman and riskrangeproperty that are updated offline and I want the symbology of the points to change based on the information entered,&lt;/P&gt;&lt;P&gt;If the value in riskrangehuman is 3 or 2 AND the value in riskrangeproperty is 3 I want it to be categorised as 'Severe Danger'&lt;/P&gt;&lt;P&gt;If the value in riskrangehuman is 2 AND the value in riskrangeproperty is 3, I want it to be categorised as 'Medium Danger'&lt;/P&gt;&lt;P&gt;For everything else I want it to be symbolised as 'Low Risk'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;When($feature.riskrangehuman == '3' || $feature.riskrangehuman == '2') &amp;amp;&amp;amp; ($feature.riskrangeproperty == '3'), 'Severe Danger'
($feature.riskrangehuman == '2') &amp;amp;&amp;amp; ($feature.riskrangeproperty == '3' || $feature.riskrangeproperty == '2'), 'Medium Risk',

'Low risk' )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get an error saying "&lt;SPAN class=""&gt;Parse Error:&lt;/SPAN&gt;&lt;SPAN&gt;Line 4: Unexpected token )"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any help would be really appreciated&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 01:53:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/symbolising-using-arcade-based-on-the-values-of-2/m-p/1182997#M46451</guid>
      <dc:creator>CourtneyWatson</dc:creator>
      <dc:date>2022-06-15T01:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Symbolising using Arcade based on the values of 2 attributes, Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/symbolising-using-arcade-based-on-the-values-of-2/m-p/1183001#M46452</link>
      <description>&lt;P&gt;Welcome to the world of Arcade! Here's what I can see:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You're missing a parenthesis. The function&amp;nbsp;&lt;STRONG&gt;When&lt;/STRONG&gt; should have all its parameters inside a single set of ( ), but your first condition is followed by a ")". This effectively closes the&amp;nbsp;&lt;STRONG&gt;Where&amp;nbsp;&lt;/STRONG&gt;function.&lt;/LI&gt;&lt;LI&gt;You're missing a comma after "Severe Danger"&lt;/LI&gt;&lt;LI&gt;You could use another line break and some indentations, it helps keep things clear and comprehensible.&lt;/LI&gt;&lt;LI&gt;Similarly, attributes that are going to be used more than once (and are quite long) can be assigned to shorter variables. This keeps your code from getting too wide.&lt;/LI&gt;&lt;LI&gt;When you're checking if something is equal to multiple values, you could also make use of the function&amp;nbsp;&lt;STRONG&gt;Includes&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;As far as the conditions themselves, however, your expression doesn't quite match up with your text. For both "Severe" and "Medium", riskrangeproperty, according to your post, should equal 3. And "Severe" has a riskrangehuman of 2 OR 3, but "Medium" has it as a 2. By that logic, any feature that meets the "Medium" criteria will also meet the "Severe" criteria.&lt;/P&gt;&lt;P&gt;Then again, your expression seems to have 2 OR 3 for riskrangeproperty in the "Medium" condition. So it's not totally clear which is the intended approach. I'll just assume the expression is the one to follow.&lt;/P&gt;&lt;P&gt;Here's your expression, with those suggestions implemented:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var rrh = $feature.riskrangehuman
var rrp = $feature.riskrangeproperty

When(
    Includes(['2', '3'], rrh) &amp;amp;&amp;amp; rrp == '3', 'Severe Danger',
    rrh == '2' &amp;amp;&amp;amp; Includes(['2', '3'], rrp), 'Medium Risk',
    'Low risk'
)&lt;/LI-CODE&gt;&lt;P&gt;The comma and parenthesis are definite must-fix items, but the rest are more personal preference. See what works for you!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 03:31:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/symbolising-using-arcade-based-on-the-values-of-2/m-p/1183001#M46452</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-06-15T03:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Symbolising using Arcade based on the values of 2 attributes, Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/symbolising-using-arcade-based-on-the-values-of-2/m-p/1183008#M46453</link>
      <description>&lt;P&gt;Perfect, thank you so much!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 04:07:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/symbolising-using-arcade-based-on-the-values-of-2/m-p/1183008#M46453</guid>
      <dc:creator>CourtneyWatson</dc:creator>
      <dc:date>2022-06-15T04:07:06Z</dc:date>
    </item>
  </channel>
</rss>

