<?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: Calculating fields based on an intersection in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1376376#M57159</link>
    <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/698509"&gt;@ShaiBravo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very strange, maybe Arcade doesn't adhere to major programming standards, but either way, it may be useful to attempt and return the intersect and overlay value, it could be the case that nothing is being used in the variable and it's just empty from the start. That's only an idea though, but may be worth a shot!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jan 2024 12:00:48 GMT</pubDate>
    <dc:creator>CodyPatterson</dc:creator>
    <dc:date>2024-01-31T12:00:48Z</dc:date>
    <item>
      <title>Calculating fields based on an intersection</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375098#M57094</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am trying to use the calculate expression using the configure form on ArcGIS online map viewer. I want to overlay a polygon on top of a layer and based on that intersection, the "CW_Status" field of the layer will switch to "Active". I also want the "CW_Status" to revert back to "Inactive" once the intersecting polygon has been removed. Here is the code I created that does not work.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Overlay polygon
var overlay = FeatureSetByName($map, "DWA_Area")

// intersecting boolean
var intersect = Intersects($feature, overlay)

if(intersect == true){
  return ($feature.CW_Status = "Active");
} else {
  return $feature.CW_Status;
}&lt;/LI-CODE&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 21:10:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375098#M57094</guid>
      <dc:creator>ShaiBravo</dc:creator>
      <dc:date>2024-01-26T21:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields based on an intersection</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375113#M57095</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/698509"&gt;@ShaiBravo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you say that the code does not work, does it not return anything, or only one of the options?&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 21:47:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375113#M57095</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-01-26T21:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields based on an intersection</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375117#M57096</link>
      <description>&lt;P&gt;Technically my code gives me a return, but the field "CW_Status" remains "Inactive" when I place the intersecting polygon over top. The expected return should be "Active"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 21:49:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375117#M57096</guid>
      <dc:creator>ShaiBravo</dc:creator>
      <dc:date>2024-01-26T21:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields based on an intersection</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375121#M57097</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/698509"&gt;@ShaiBravo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was curious if it could be in the formatting of your if statement, is the default "Inactive"? If so, maybe attempt to do this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if (intersect) {
  return "Active";
} else {
  return "Inactive";
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Only because maybe it has to do with true maybe being True, or another form different, this should be a definitive as the already is a boolean when assigned I believe!&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 21:52:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375121#M57097</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-01-26T21:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields based on an intersection</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375134#M57101</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I get a "Test execution error: Execution error - Conditions must use booleans. Verify test data." error when I use the new method. When I use this method, I get an "Inactive" return&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;if(intersect == true){
  return "Active";
} else {
  return "Inactive";
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 26 Jan 2024 22:40:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1375134#M57101</guid>
      <dc:creator>ShaiBravo</dc:creator>
      <dc:date>2024-01-26T22:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields based on an intersection</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1376376#M57159</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/698509"&gt;@ShaiBravo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very strange, maybe Arcade doesn't adhere to major programming standards, but either way, it may be useful to attempt and return the intersect and overlay value, it could be the case that nothing is being used in the variable and it's just empty from the start. That's only an idea though, but may be worth a shot!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 12:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1376376#M57159</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-01-31T12:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating fields based on an intersection</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1376565#M57167</link>
      <description>&lt;P&gt;Just adding to this if anybody is interested.&lt;BR /&gt;&lt;BR /&gt;I chatted with Esri yesterday and they consider my method another version of bulk editing which is not supported on Experience Builder. They then suggested I try to use the calculate field in the data management of the layer. By trying this method, my code does not work because it can only use the features within the layer. So it seems like there is no way to do what I want to accomplish with the tools Esri has available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will update if I can come up with a solution.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 17:01:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/calculating-fields-based-on-an-intersection/m-p/1376565#M57167</guid>
      <dc:creator>ShaiBravo</dc:creator>
      <dc:date>2024-01-31T17:01:24Z</dc:date>
    </item>
  </channel>
</rss>

