<?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 - Intersect and Find Features with Defined Value in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278443#M51448</link>
    <description>&lt;P&gt;It might be confusing if you look at the documentation for the Array &lt;A href="https://developers.arcgis.com/arcade/function-reference/array_functions/" target="_self"&gt;Filter&lt;/A&gt; function (which uses a Boolean filterFunction) instead of the FeatureSet &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter" target="_self"&gt;Filter&lt;/A&gt; function (which uses an SQL92 expression).&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 18:04:52 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2023-04-13T18:04:52Z</dc:date>
    <item>
      <title>Arcade Expression - Intersect and Find Features with Defined Value</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278411#M51444</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am having some trouble getting an Arcade Expression to work and am hoping for some help! I have developed a Web App using ArcGIS Web Maps/Dashboard and Survey123. This application allows our local area hospitals to update themselves and their Diversion Status. The hospitals can put themselves on Diversion status of colors such as "Green" "Yellow" "Red" to indicate whether they can accept patients via ambulance or not. Only one hospital can be on "Red" at any given time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to write an expression to intersect the hospitals layer which is a hosted view of the current statuses and determine whether any of the hospitals currently have a status of Red or not. If they do it can return which hospital is "Red" and if none then "None Red". Once I can get that expression working I can pass that off to Survey123 to limit the answers the other hospitals can select from to remove red. I have tried the below expression with numerous modifications but keep getting the error "h.charAt is not a function". Can someone help me figure out what I am doing wrong?&lt;/P&gt;&lt;P&gt;var bufferDistance = 25; // buffer distance in miles&lt;BR /&gt;var bufferGeometry = Buffer($feature, bufferDistance, 'miles');&lt;BR /&gt;var intersectedFeatures = Intersects(bufferGeometry, FeatureSetByName($map, 'Current_Hospital_Statuses'));&lt;BR /&gt;var filteredFeatures = Filter(intersectedFeatures, $feature.diversionstatus == 'red');&lt;/P&gt;&lt;P&gt;if (Count(filteredFeatures) &amp;gt; 0) {&lt;BR /&gt;var matchingFeature = First(filteredFeatures); // get first matching feature&lt;BR /&gt;var name = matchingFeature['hospitalname']; // get name attribute value&lt;BR /&gt;return name; // return name value&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;return 'None Red'; // return error message if no matches found&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:31:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278411#M51444</guid>
      <dc:creator>LukeCulleny</dc:creator>
      <dc:date>2023-04-13T17:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression - Intersect and Find Features with Defined Value</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278431#M51445</link>
      <description>&lt;P&gt;I think the error is in your Filter. Try this instead&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var filteredFeatures = Filter(intersectedFeatures, "diversionstatus = 'red'");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:49:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278431#M51445</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-04-13T17:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression - Intersect and Find Features with Defined Value</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278435#M51446</link>
      <description>&lt;P&gt;You sir are a genius! That worked perfectly, thank you so much for taking the time to help me! I get somewhat confused with Arcade and tried to have ChatGPT help me and it just must not know the syntax. Thank you again for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278435#M51446</guid>
      <dc:creator>LukeCulleny</dc:creator>
      <dc:date>2023-04-13T17:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression - Intersect and Find Features with Defined Value</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278443#M51448</link>
      <description>&lt;P&gt;It might be confusing if you look at the documentation for the Array &lt;A href="https://developers.arcgis.com/arcade/function-reference/array_functions/" target="_self"&gt;Filter&lt;/A&gt; function (which uses a Boolean filterFunction) instead of the FeatureSet &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter" target="_self"&gt;Filter&lt;/A&gt; function (which uses an SQL92 expression).&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 18:04:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-intersect-and-find-features-with/m-p/1278443#M51448</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-04-13T18:04:52Z</dc:date>
    </item>
  </channel>
</rss>

