<?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 if/or/default statements in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1030560#M38674</link>
    <description>&lt;P&gt;wow! thanks!!!&lt;/P&gt;&lt;P&gt;I tried it but it won't display n/a.... am I missing something?&lt;/P&gt;&lt;P&gt;thanks again for your time - very much appreciated&lt;/P&gt;&lt;P&gt;intersect (pink is 'h overlay')&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aroininen_0-1614274255167.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6930i2AE0CB6E95529998/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aroininen_0-1614274255167.png" alt="aroininen_0-1614274255167.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;no intersect&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aroininen_1-1614274308541.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6931iB924BA397C8FC86C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aroininen_1-1614274308541.png" alt="aroininen_1-1614274308541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Feb 2021 17:33:38 GMT</pubDate>
    <dc:creator>aroininen</dc:creator>
    <dc:date>2021-02-25T17:33:38Z</dc:date>
    <item>
      <title>Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1030440#M38669</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;I am having a problem adding a logical function into an arcade state I have scraped together from the web. I am not a programmer more of a edit existing code kind of person. I will try to keep this simple.&lt;/P&gt;&lt;P&gt;Here is the expression I have that intersects features and provides results for what its within - landuse info&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var intersectLayer =Intersects(FeatureSetByName($map,"LandUse - h Provision Overlay"), Buffer($feature, -10, 'feet'))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var Hazard = "";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for (var f in intersectLayer) {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if (Hazard == "") {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Hazard = f.NAME&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;} else {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Hazard += " And " + f.NAME;}}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;return Hazard&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;the result is this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aroininen_1-1614262634335.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6897iF0DF087AF268C1BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aroininen_1-1614262634335.png" alt="aroininen_1-1614262634335.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't know how to insert a logical function into this expression so empty values display "n/a"&lt;/P&gt;&lt;P&gt;I have tried:&amp;nbsp;IIf ,&amp;nbsp;IsEmpty, DefaultValue all kinds I just don't know how to fit them in&lt;/P&gt;&lt;P&gt;any help would be greatly appreciated!!!&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also, can someone explained what the word hazard is for? it was just with the code so I left it in!&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 14:24:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1030440#M38669</guid>
      <dc:creator>aroininen</dc:creator>
      <dc:date>2021-02-25T14:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1030494#M38671</link>
      <description>&lt;P&gt;"Hazard" is the name of the variable that stores your text. You can call it pretty much anything you want, though descriptive names are the most sensible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Get all features of the LandUse layer that are intersected by the selected feature.
// You apply a negative buffer here, so you don't get land use features that only intersect with the outer edges, is that correct?
var intersect_layer = Intersects(FeatureSetByName($map, "LandUse - h Provision Overlay"), Buffer($feature, -10, 'feet'))

// Define and initialize the variable that stores your text
var intersected_land_uses = ""

// Loop through the intersecting land use features
for (var f in intersect_layer ) {
  var land_use = IIF(IsEmpty(f.NAME), "n/a", f.NAME)
  if (intersected_land_uses == "") { // there is nothing in here yet
    intersected_land_uses = land_use
  } else { // there is something in here already, append with " And "
    intersected_land_uses += " And " + land_use
  }
}
return intersected_land_uses&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;</description>
      <pubDate>Thu, 25 Feb 2021 15:57:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1030494#M38671</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-02-25T15:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1030560#M38674</link>
      <description>&lt;P&gt;wow! thanks!!!&lt;/P&gt;&lt;P&gt;I tried it but it won't display n/a.... am I missing something?&lt;/P&gt;&lt;P&gt;thanks again for your time - very much appreciated&lt;/P&gt;&lt;P&gt;intersect (pink is 'h overlay')&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aroininen_0-1614274255167.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6930i2AE0CB6E95529998/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aroininen_0-1614274255167.png" alt="aroininen_0-1614274255167.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;no intersect&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aroininen_1-1614274308541.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/6931iB924BA397C8FC86C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aroininen_1-1614274308541.png" alt="aroininen_1-1614274308541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 17:33:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1030560#M38674</guid>
      <dc:creator>aroininen</dc:creator>
      <dc:date>2021-02-25T17:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031790#M38719</link>
      <description>&lt;P&gt;So where it says "Hazard", it should say "n/a", right? Or is "Hazard" a land use?&lt;/P&gt;&lt;P&gt;Can you post the code you used, please?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 05:55:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031790#M38719</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-03-02T05:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031894#M38722</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;No I want it to show n/a after 'h Overlay"&amp;nbsp; as it is outside of zone&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aroininen_0-1614693246413.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7266iC3A5837E5E4744CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aroininen_0-1614693246413.png" alt="aroininen_0-1614693246413.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 13:54:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031894#M38722</guid>
      <dc:creator>aroininen</dc:creator>
      <dc:date>2021-03-02T13:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031898#M38723</link>
      <description>&lt;P&gt;Ah, I think I misunderstood your original question...&lt;/P&gt;&lt;P&gt;Does this do what you want?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Get all features of the LandUse layer that are intersected by the selected feature.
// You apply a negative buffer here, so you don't get land use features that only intersect with the outer edges, is that correct?
var intersect_layer = Intersects(FeatureSetByName($map, "LandUse - h Provision Overlay"), Buffer($feature, -10, 'feet'))

// No intersecting features found -&amp;gt; "n/a"
if(Count(intersect_layer) == 0) {
  return "n/a"
}

// Define and initialize the variable that stores your text
var intersected_land_uses = ""

// Loop through the intersecting land use features
for (var f in intersect_layer ) {
  var land_use = IIF(IsEmpty(f.NAME), "n/a", f.NAME)
  if (intersected_land_uses == "") { // there is nothing in here yet
    intersected_land_uses = land_use
  } else { // there is something in here already, append with " And "
    intersected_land_uses += " And " + land_use
  }
}
return intersected_land_uses&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 14:00:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031898#M38723</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-03-02T14:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031924#M38724</link>
      <description>&lt;P&gt;thanks again for you help but I get this error&lt;/P&gt;&lt;P&gt;&lt;SPAN class="text-red"&gt;Execution Error:&lt;/SPAN&gt;&lt;SPAN&gt;Invalid Parameters for Count....?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 14:57:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031924#M38724</guid>
      <dc:creator>aroininen</dc:creator>
      <dc:date>2021-03-02T14:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031927#M38725</link>
      <description>&lt;P&gt;could I use "Touches' instead of "intersect...?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 14:59:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031927#M38725</guid>
      <dc:creator>aroininen</dc:creator>
      <dc:date>2021-03-02T14:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031952#M38727</link>
      <description>&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#intersects" target="_blank" rel="noopener"&gt;Intersects&lt;/A&gt; and &lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#touches" target="_blank" rel="noopener"&gt;Touches&lt;/A&gt; both have pictures indicating what will be selected. Based on your screenshots above, your "h overlay" layer intersects your parcels, so you probably should use Intersects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know what's wrong with the code, it works for me. Maybe someone else can help? &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt; , &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt; ?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 15:43:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031952#M38727</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-03-02T15:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031970#M38728</link>
      <description>&lt;P&gt;Thanks!!! I will keep playing with my code!!&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 16:16:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031970#M38728</guid>
      <dc:creator>aroininen</dc:creator>
      <dc:date>2021-03-02T16:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade if/or/default statements</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031977#M38729</link>
      <description>&lt;P&gt;My bad - I had the $mapp \layer wrong!&lt;/P&gt;&lt;P&gt;nailed it!!&lt;/P&gt;&lt;P&gt;Thanks for all your help - I will click solved!!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aroininen_0-1614702278585.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7286iC5CA7EF0F6900678/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aroininen_0-1614702278585.png" alt="aroininen_0-1614702278585.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 16:25:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-if-or-default-statements/m-p/1031977#M38729</guid>
      <dc:creator>aroininen</dc:creator>
      <dc:date>2021-03-02T16:25:04Z</dc:date>
    </item>
  </channel>
</rss>

