<?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>idea Arcade within() actually queries the feature it is within in Attribute Rules Ideas</title>
    <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idi-p/1326133</link>
    <description>&lt;P&gt;I am using the within() function to query an underlying feature class. Then calculating fields based on the values pulled from the within(). If the feature is an odd shape it will return nothing or the wrong value. I am using this syntax, within( querylayer&amp;nbsp; &amp;nbsp;,centroid($feature)). Sometimes the centroid is outside of the feature.&lt;/P&gt;&lt;P&gt;In the image below, the within function is using the red point to query the 31E33AD polygon. I need the function to query the 31E33 polygon using the green point. If I remove the centroid function, within() returns nothing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Red is the centroid used by the within() function." style="width: 500px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80027i5E7630B58B17B3D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Centroid Example 2.jpg" alt="Red is the centroid used by the within() function." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Red is the centroid used by the within() function.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My suggestion is to create a function that uses a center point within the selected feature. Or fix the centroid function to place the point within the feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2023 20:45:19 GMT</pubDate>
    <dc:creator>JonathanMcDowell1</dc:creator>
    <dc:date>2023-09-06T20:45:19Z</dc:date>
    <item>
      <title>Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idi-p/1326133</link>
      <description>&lt;P&gt;I am using the within() function to query an underlying feature class. Then calculating fields based on the values pulled from the within(). If the feature is an odd shape it will return nothing or the wrong value. I am using this syntax, within( querylayer&amp;nbsp; &amp;nbsp;,centroid($feature)). Sometimes the centroid is outside of the feature.&lt;/P&gt;&lt;P&gt;In the image below, the within function is using the red point to query the 31E33AD polygon. I need the function to query the 31E33 polygon using the green point. If I remove the centroid function, within() returns nothing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Red is the centroid used by the within() function." style="width: 500px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80027i5E7630B58B17B3D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Centroid Example 2.jpg" alt="Red is the centroid used by the within() function." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Red is the centroid used by the within() function.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My suggestion is to create a function that uses a center point within the selected feature. Or fix the centroid function to place the point within the feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 20:45:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idi-p/1326133</guid>
      <dc:creator>JonathanMcDowell1</dc:creator>
      <dc:date>2023-09-06T20:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within - Status changed to: Needs Clarification</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326136#M159</link>
      <description>&lt;P&gt;Have you tried using&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#relate" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/geometry_functions/#relate&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 21:01:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326136#M159</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2023-09-06T21:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326139#M160</link>
      <description>&lt;P&gt;I am not sure this will work. I am using the values from one feature class to calculate values of another feature class. In this cause, the is a index feature class storing key values for the parcel layer. I use the attribute rule to pull a value from the index feature class. Then using that value calculate fields in the parcel layer.&lt;/P&gt;&lt;P&gt;If I am understanding the linked documentation, it is just performing a check to see if the features are related.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 21:08:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326139#M160</guid>
      <dc:creator>JonathanMcDowell1</dc:creator>
      <dc:date>2023-09-06T21:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326143#M161</link>
      <description>&lt;P&gt;It used&amp;nbsp;DE-9IM&amp;nbsp;to determine the spatial relationship.&amp;nbsp; You can use&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#intersects" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/geometry_functions/#intersects&lt;/A&gt;&amp;nbsp;to get all intersecting points and if you need to ensure it is in your polygon, use related to ensure the point is in and not on the boundary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or maybe Intersect is enough for what you are looking for&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 21:15:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326143#M161</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2023-09-06T21:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326144#M162</link>
      <description>&lt;P&gt;Sorry, wrong link, try this version of Intersects:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#intersects" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/featureset_functions/#intersects&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 21:16:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326144#M162</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2023-09-06T21:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326308#M163</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/37039"&gt;@JonathanMcDowell1&lt;/a&gt;&amp;nbsp;is the&amp;nbsp;&lt;SPAN&gt;31E33 polygon a curved or "moon" shaped feature such as below. When getting geometry of the centroid it is actually outside the feature.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JakeSimms1_1-1694085838213.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80067i6B6F1E143FC983B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JakeSimms1_1-1694085838213.png" alt="JakeSimms1_1-1694085838213.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have run into this issue before and the solution was to create a negative buffer object with the &lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#buffer" target="_self"&gt;Buffer()&lt;/A&gt;&amp;nbsp;function then use that object as the innerGeometry for the &lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#within" target="_self"&gt;Within()&lt;/A&gt; function.&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Note: I noticed in your first comments you had&amp;nbsp;within( querylayer ,centroid($feature)), this is reversed how you want it. The syntax for within is Within(innerGeometry, outerGeometry). In your case, would the innerGeometry want to be the&amp;nbsp;centroid($feature) and the outerGeometry be the&amp;nbsp;querylayer?&amp;nbsp;within( centroid($feature),querylayer).&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 11:32:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326308#M163</guid>
      <dc:creator>JakeSimms1</dc:creator>
      <dc:date>2023-09-07T11:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326432#M164</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/262242"&gt;@JakeSimms1&lt;/a&gt;&amp;nbsp;This is the exact problem I am dealing with. The feature I am working with is a long curving railroad right-of-way. It is 60' wide and 2 miles long. I did try a negative buffer, however it did not move the point close to where it is needed. In this case, the features I am using for the within() are topologically identical. So a within() should work.&lt;/P&gt;&lt;P&gt;Thanks for pointing out the syntax. I will switch the inputs and see what happens.&lt;/P&gt;&lt;P&gt;My next test is to use intersect() with the negative buffer. If I am correct, I want to use the offset() function?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 15:38:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326432#M164</guid>
      <dc:creator>JonathanMcDowell1</dc:creator>
      <dc:date>2023-09-07T15:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326487#M165</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/37039"&gt;@JonathanMcDowell1&lt;/a&gt;&amp;nbsp;You should be able to use the Intersect() to get the field values you need without using Offset().&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code might not be what you're looking for but how you would roughly do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var bufferFeature = Buffer($feature,-10)//of some number
var fcIntersect = Intersects(FeatureSetByName($datastore, ["featureToIntersect"], ["fieldValue1","fieldValue2"], false), bufferFeature)

if (IsEmpty(fcIntersect)){
    return;
}

if (Count(fcIntersect) &amp;gt;= 1) {
    var select = first(fcIntersect)
    
    return {
        "result": { 
            "attributes": {
                "field1": select.fieldValue1,
                "field2": select.fieldValue2
            }
        }
    
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 17:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326487#M165</guid>
      <dc:creator>JakeSimms1</dc:creator>
      <dc:date>2023-09-07T17:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326509#M166</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/262242"&gt;@JakeSimms1&lt;/a&gt;&amp;nbsp;is exactly what I want to do. However, it throws an error when I try saving it. The error states the expression for line 2 is invalid. It cannot preform the function on an empty geometry.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 17:50:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326509#M166</guid>
      <dc:creator>JonathanMcDowell1</dc:creator>
      <dc:date>2023-09-07T17:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326576#M167</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/37039"&gt;@JonathanMcDowell1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I may be wrong but the error thrown is because the "false" in the line 2.&lt;/P&gt;&lt;P&gt;Change the "false" to "true" like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fcIntersect = Intersects(FeatureSetByName($datastore, ["featureToIntersect"], ["fieldValue1","fieldValue2"], true), bufferFeature)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 20:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326576#M167</guid>
      <dc:creator>HNTZK46</dc:creator>
      <dc:date>2023-09-07T20:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326824#M168</link>
      <description>&lt;P&gt;Esri nees to add an 'inside' parameter to the centroid() function, for example, centroid($feature, 'inside').&amp;nbsp; This addition has the potential to save developers a lot of time tryting to code around the problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 15:49:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1326824#M168</guid>
      <dc:creator>JonathanMcDowell1</dc:creator>
      <dc:date>2023-09-08T15:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331750#M174</link>
      <description>&lt;P&gt;The following code uses intersect and gets the largest intersecting polygon to make the assignment. It appears to be an OK workaround.&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Get map number from mapindex polygon layer using interesect&lt;BR /&gt;// Do interesect and county features.&lt;/P&gt;&lt;P&gt;var fsMapIndex = FeatureSetByName($datastore,"MapIndex",["MapNumber","ORMapNum","County"])&lt;BR /&gt;var fsIntersectMap = Intersects(fsMapIndex,$feature)&lt;BR /&gt;var MapIndex = first(fsIntersectMap)&lt;BR /&gt;var intcount = Count(fsIntersectMap)&lt;/P&gt;&lt;P&gt;// If no features return error&lt;/P&gt;&lt;P&gt;if (MapIndex == null) return {"errorMessage": "No Map Index Feature Found"}&lt;BR /&gt;if (MapIndex.Mapnumber == null) return {"errorMessage": "MapNumber is empty"}&lt;/P&gt;&lt;P&gt;// If count is one then return values&lt;/P&gt;&lt;P&gt;if (intcount == 1) return {&lt;BR /&gt;"result": {&lt;BR /&gt;"attributes" :{&lt;BR /&gt;"MapNumber" : MapIndex.MapNumber,&lt;BR /&gt;"ORMapNum" : MapIndex.ORMAPNum,&lt;BR /&gt;"County" : MapIndex.County&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// if county &amp;gt; 1 (taxlot overlaps mapindex) then&lt;BR /&gt;// loop thru and keep intersect with largest area.&lt;/P&gt;&lt;P&gt;else {&lt;BR /&gt;var MapNumber = " "&lt;BR /&gt;var ORMAPNum = " "&lt;BR /&gt;var County = 0&lt;BR /&gt;var intersectarea = 0&lt;BR /&gt;for (var f in fsIntersectMap){&lt;BR /&gt;var newintersectarea = Area(Intersection($feature,f))&lt;BR /&gt;if (newintersectarea &amp;gt; intersectarea){&lt;BR /&gt;var MapNumber = f.MapNumber&lt;BR /&gt;var ORMAPNum = f.ORMAPNum&lt;BR /&gt;var County = f.County&lt;BR /&gt;intersectarea = newintersectarea}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;"result": {&lt;BR /&gt;"attributes" :{&lt;BR /&gt;"MapNumber" : MapNumber,&lt;BR /&gt;"ORMapNum" : ORMAPNum,&lt;BR /&gt;"County" : County&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 23 Sep 2023 12:51:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331750#M174</guid>
      <dc:creator>DeanAnderson2</dc:creator>
      <dc:date>2023-09-23T12:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331928#M175</link>
      <description>Do not call Count and First on the FeatureSet. This will cause unnecessary database queries. Just loop over the featureset and handle if the results are empty(none) and get the largest.&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Sep 2023 12:38:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331928#M175</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2023-09-25T12:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331933#M176</link>
      <description>&lt;P&gt;Thanks - that makes sense.&amp;nbsp; Built this off of old code and was just pretty focused on making the area check work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 12:43:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331933#M176</guid>
      <dc:creator>DeanAnderson2</dc:creator>
      <dc:date>2023-09-25T12:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331937#M177</link>
      <description>&lt;P&gt;Better code - Again Thanks !&lt;/P&gt;&lt;P&gt;// Get map number from mapindex polygon layer&lt;BR /&gt;var fsMapIndex = FeatureSetByName($datastore,"MapIndex",["MapNumber","ORMapNum","County"])&lt;BR /&gt;var fsIntersectMap = Intersects(fsMapIndex,$feature)&lt;/P&gt;&lt;P&gt;if (fsIntersectMap == null) return {"errorMessage": "No Map Index Feature Found"}&lt;/P&gt;&lt;P&gt;var MapNumber = "None"&lt;BR /&gt;var ORMAPNum = "None"&lt;BR /&gt;var County = 99&lt;BR /&gt;var intersectarea = 0&lt;BR /&gt;for (var f in fsIntersectMap){&lt;BR /&gt;var newintersectarea = Area(Intersection($feature,f))&lt;BR /&gt;if (newintersectarea &amp;gt; intersectarea){&lt;BR /&gt;var MapNumber = f.MapNumber&lt;BR /&gt;var ORMAPNum = f.ORMAPNum&lt;BR /&gt;var County = f.County&lt;BR /&gt;intersectarea = newintersectarea}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return {&lt;BR /&gt;"result": {&lt;BR /&gt;"attributes" :{&lt;BR /&gt;"MapNumber" : MapNumber,&lt;BR /&gt;"ORMapNum" : ORMAPNum,&lt;BR /&gt;"County" : County&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 12:52:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331937#M177</guid>
      <dc:creator>DeanAnderson2</dc:creator>
      <dc:date>2023-09-25T12:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331939#M178</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking good, just a little clean up&lt;/P&gt;&lt;P&gt;No reason to check the FS for null.&amp;nbsp; Think of a FS as a database cursor.&amp;nbsp; Just cycle over it and check if the results are null afterwards&lt;/P&gt;&lt;P&gt;Declare your variables outside the loop&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Get map number from mapindex polygon layer
var fsMapIndex = FeatureSetByName($datastore, "MapIndex", ["MapNumber", "ORMapNum", "County"])
var fsIntersectMap = Intersects(fsMapIndex, $feature)

var MapNumber = null;
var ORMAPNum = null;
var County = null;
var intersectarea = 0
var newintersectarea
for (var f in fsIntersectMap) {
    newintersectarea = Area(Intersection($feature, f))
    if (newintersectarea &amp;gt; intersectarea) {
        MapNumber = f.MapNumber
        ORMAPNum = f.ORMAPNum
        County = f.County
        intersectarea = newintersectarea
    }
}


if (MapNumber == null) {
    return {
        "errorMessage": "No Map Index Feature Found"
    }
}

return {
    "result": {
        "attributes": {
            "MapNumber": MapNumber,
            "ORMapNum": ORMAPNum,
            "County": County
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 13:08:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331939#M178</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2023-09-25T13:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade within() actually queries the feature it is within</title>
      <link>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331940#M179</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp; Always good to have somebody cleanup my code.&amp;nbsp; Much appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 13:09:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-ideas/arcade-within-actually-queries-the-feature-it-is/idc-p/1331940#M179</guid>
      <dc:creator>DeanAnderson2</dc:creator>
      <dc:date>2023-09-25T13:09:43Z</dc:date>
    </item>
  </channel>
</rss>

