<?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 Expression for value ranges in ArcGIS Online Developers Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-value-ranges/m-p/1308766#M1256</link>
    <description>&lt;P&gt;Thank you Johannes! This worked perfectly!&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 19:32:33 GMT</pubDate>
    <dc:creator>MarkSenne</dc:creator>
    <dc:date>2023-07-17T19:32:33Z</dc:date>
    <item>
      <title>Arcade Expression for value ranges</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-value-ranges/m-p/1308239#M1254</link>
      <description>&lt;P&gt;In need help with an arcade expression that will allow a 'pass/fail' value when an end user selects a point and whatever value that enter cause a pass/fail prompt. I currently have it setup properly when they are concerned whether or not a value is above or below a certain value but now they are wanting it to work for range values meaning if the value is between 6-9 then it would cause a pass prompt and any values outside of that would be a fail. The script below works for the greater/lesser than parameters but I'm having a hard time making it work for ranges.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;Zinc&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Zinc&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;Zinc&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;0.067&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;Zinc&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;' mg/l (Fail)'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt; &lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;Zinc&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;0.067&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;Zinc&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;' mg/l (Pass)'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Jul 2023 15:45:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-value-ranges/m-p/1308239#M1254</guid>
      <dc:creator>MarkSenne</dc:creator>
      <dc:date>2023-07-14T15:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for value ranges</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-value-ranges/m-p/1308388#M1255</link>
      <description>&lt;P&gt;To post code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1689266678674.png" style="width: 546px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75345i1DB988B7B4303219/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_0-1689266678674.png" alt="JohannesLindner_0-1689266678674.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1689266693900.png" style="width: 469px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75346i06615A9413162052/image-size/large?v=v2&amp;amp;px=999" role="button" title="JohannesLindner_1-1689266693900.png" alt="JohannesLindner_1-1689266693900.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your example will return null for zinc == 0.067! Also, it can be simplified like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var zinc = $feature.Zinc
var status = IIf(zinc &amp;gt; 0.067, 'Fail', 'Pass')
return `${zinc} mg/l (${status})`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For ranges, you just have to edit the boolean evaluation in IIf():&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var zinc = $feature.Zinc
var status = IIf(zinc &amp;gt;= 6 &amp;amp;&amp;amp; zinc &amp;lt;= 9, 'Pass', 'Fail')
return `${zinc} mg/l (${status})`&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 14 Jul 2023 23:21:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-value-ranges/m-p/1308388#M1255</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-07-14T23:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression for value ranges</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-value-ranges/m-p/1308766#M1256</link>
      <description>&lt;P&gt;Thank you Johannes! This worked perfectly!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 19:32:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-for-value-ranges/m-p/1308766#M1256</guid>
      <dc:creator>MarkSenne</dc:creator>
      <dc:date>2023-07-17T19:32:33Z</dc:date>
    </item>
  </channel>
</rss>

