<?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 Run spatial query when a new feature has been created in a feature layer in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1239153#M63165</link>
    <description>&lt;P&gt;I have a feature layer with 3 values that exist in other layers that contain information that I want stored in the point layer. I need to run a spatial query when a new feature has been created to look up data in these other 2 layers &amp;amp; then record this data in the main point layer. How can you achieve this?&lt;/P&gt;</description>
    <pubDate>Thu, 08 Dec 2022 15:04:37 GMT</pubDate>
    <dc:creator>AndrewReynoldsDevon</dc:creator>
    <dc:date>2022-12-08T15:04:37Z</dc:date>
    <item>
      <title>Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1239153#M63165</link>
      <description>&lt;P&gt;I have a feature layer with 3 values that exist in other layers that contain information that I want stored in the point layer. I need to run a spatial query when a new feature has been created to look up data in these other 2 layers &amp;amp; then record this data in the main point layer. How can you achieve this?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 15:04:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1239153#M63165</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2022-12-08T15:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1239553#M63214</link>
      <description>&lt;P&gt;I think you can do that with attribute rules in PRO.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/an-overview-of-attribute-rules.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/an-overview-of-attribute-rules.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have a similar need. Create a point feature in a Parcel, grab some info from the intersecting parcel and populate it in the new feature.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 10:26:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1239553#M63214</guid>
      <dc:creator>Alaind_Espaignet</dc:creator>
      <dc:date>2022-12-09T10:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1239564#M63217</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/28514"&gt;@Alaind_Espaignet&lt;/a&gt;&amp;nbsp;said, that's a very common use case for Attribute Rules.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A very basic Attribute rule for transferring a single value (&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/28514"&gt;@Alaind_Espaignet&lt;/a&gt;&amp;nbsp;scenario):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Calculation Attribute Rule on the point fc
// field: the field you want to fill
// triggers: Insert(, Update)

// load the other featureset
var fs = FeaturesetByName($datastore, "NameOfTheFC")
// get the first feature from fs that intersects the current $feature
var f = First(Intersects(fs, $feature))
// abort if we didn't find something
if(f == null) { return }
// return the intersecting feature's value
return f.Field&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And for multiple fields (&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/551141"&gt;@AndrewReynoldsDevon&lt;/a&gt;&amp;nbsp;scenario):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Calculation Attribute rule on the point fc
// field: empty!
// triggers: Insert(, Update)

// load the other featuresets
var fs1 = FeaturesetByName($datastore, "NameOfTheFirstFC")
var fs2 = FeaturesetByName($datastore, "NameOfTheSecondFC")

// get the first feature from fs1 that intersects the current $feature
var f1 = First(Intersects(fs1, $feature))
// if there is no intersecting feature, use a default value, else use that feature's field value
var value1 = Iif(f1 == null, null, f1.Field)

// do the same for fs2
var f2 = First(Intersects(fs2, $feature))
var value2 = Iif(f2 == null, null, f2.Field)

// return
return {
    result: {attributes: {
        Field1: value1,
        Field2: value2
    }}
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Dec 2022 11:09:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1239564#M63217</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-12-09T11:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248494#M64271</link>
      <description>&lt;P&gt;ok thanks - the feature layer will exist as a layer on a webmap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;with the code above do I add that to the feature whilst in Pro then publish to our enterprise server?&lt;/P&gt;&lt;P&gt;Once published with the updated attribute info will the code then be active?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 16:44:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248494#M64271</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-16T16:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248589#M64283</link>
      <description>&lt;P&gt;That's the plan, yes.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 07:20:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248589#M64283</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-17T07:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248602#M64285</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp; - rather than intersecting I need to use 'contains within'. The source information are names of people which are polygons &amp;amp; we're creating points. Therefore the query will need to be something like&amp;nbsp; - when a point is created in this particular polygon look up these 2 values - the name of the person who is responsible for the polygon &amp;amp; the polygon area name. These 2 values will the populate the fields in the point class.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 09:39:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248602#M64285</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-17T09:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248609#M64287</link>
      <description>&lt;P&gt;Also does all of the required data need to live within the same project/map service or can the code work with other layers that already exist on our enterprise server?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 10:06:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248609#M64287</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-17T10:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248615#M64288</link>
      <description>&lt;P&gt;The arcade code can't find the name of the feature?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip.JPG" style="width: 521px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60530iC505F958B8E0D47F/image-size/large?v=v2&amp;amp;px=999" role="button" title="snip.JPG" alt="snip.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 10:59:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248615#M64288</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-17T10:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248618#M64289</link>
      <description>&lt;P&gt;I have a field in the point feature class with the same name as the field that I'm looking up in the other layer. I specified this field when creating the expression but do you need to specify it in the code?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip 2].JPG" style="width: 413px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60532i989C6745BA4A14FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="snip 2].JPG" alt="snip 2].JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 11:13:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248618#M64289</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-17T11:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248682#M64294</link>
      <description>&lt;P&gt;The name of the field is the same in both the point fc &amp;amp; the polygon. The value is blank in the point fc but I want it grab the value from the polygon class then return that value &amp;amp; save it in the point fc&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 14:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248682#M64294</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-17T14:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248685#M64295</link>
      <description>&lt;P&gt;If I create a point &amp;amp; it saves it returns the value of Null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 14:33:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248685#M64295</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-17T14:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248992#M64323</link>
      <description>&lt;P&gt;Sorry, I forgot to answer yesterday...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;does all of the required data need to live within the same project/map service or can the code work with other layers that already exist on our enterprise server?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The data has to be in the same datastore for the &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyname" target="_blank" rel="noopener"&gt;FeaturesetByName()&lt;/A&gt; function. If you have data in your Portal, you can use that with the &lt;A href="https://developers.arcgis.com/arcade/function-reference/portal_functions/#featuresetbyportalitem" target="_blank" rel="noopener"&gt;FeaturesetByPortalItem()&lt;/A&gt;&amp;nbsp; function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The arcade code can't find the name of the feature?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;There's a space in the name ("Feature X"), which is not allowed for feature classes. You're probably trying to input the feature class's alias. You have to use the actual name.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I have a field in the point feature class with the same name as the field that I'm looking up in the other layer. I specified this field when creating the expression but do you need to specify it in the code?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Yes. The &lt;STRONG&gt;f.Field&lt;/STRONG&gt; in my sample expressions was meant as a placeholder for the actual field names.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;rather than intersecting I need to use 'contains within'.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It doesn't work that way around, which is also why you get null. This is the signature of &lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#contains" target="_blank" rel="noopener"&gt;Contains()&lt;/A&gt;:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;H4&gt;Contains(containerGeometry, insideFeatures)&lt;/H4&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It expects a geometry or feature as first argument and a featureset as second argument. You're supplying a featureset (the polygons) as first argument and a feature (the point) as second. And even if you do it the right way, it won't return any results, because a point can't contain a polygon. You have to use Intersects(), which is OK, because if a polygon contains a point, that point will intersect the polygon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Therefore the query will need to be something like&amp;nbsp; - when a point is created in this particular polygon look up these 2 values - the name of the person who is responsible for the polygon &amp;amp; the polygon area name. These 2 values will the populate the fields in the point class.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;So the rule would look like this (mashup of my two previous examples, with more descriptive variable names)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// field for the rule: empty


// load the polygon feature class
var polygons = FeaturesetByName($datastore, "NameOfThePolygonFeatureClass")

// get the first polygon that intersects this point
var i_polygon = First(Intersects(polygons, $feature))

// get the responsible person
var person = Iif(i_polygon == null, null, i_polygon.ResponsiblePeron)

// get the polygon's name
var name = Iif(i_polygon == null, null, i_polygon.PolygonName)

// return
return {
    result: {attributes: {
        ResponsiblePerson: person,
        PolygonName: name
    }}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Things you have to change:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;name (not alias!) of the polygon feature class, line 5&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;field name (not alias!) for the person in the polygon fc (line 11) and the point fc (line 19)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;field name (not alias!) for the polygon's name (lines 14 and 20)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 10:11:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248992#M64323</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-18T10:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248995#M64324</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you explanation above. The code I'm using now is below where I have replaced the names of the fields as you said.&lt;/P&gt;&lt;P&gt;On line 5 I used the name of the Polygon feature&lt;/P&gt;&lt;P&gt;On line 11 &amp;amp; 19 I've used 'ElectoralArea'&amp;nbsp; which is the field that I want to obtain the value from.&lt;/P&gt;&lt;P&gt;On line 14 &amp;amp; 20 I've used&amp;nbsp;'ElectoralArea' again.&lt;/P&gt;&lt;P&gt;I have the the field&amp;nbsp;'ElectoralArea' in the point fc which is blank &amp;amp; the values are contained within the polygon layer.&amp;nbsp; When I create the attribute rule I set the field to ElectoralArea.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// field for the rule: empty

// load the polygon feature class
var polygons = FeatureSetByName($datastore, "Highways.HIGHWAYMGR.HWDataCollectionPoly")

// get the first polygon that intersects this point
var i_polygon = First(Intersects(polygons, $feature))

// get the responsible person
var person = Iif(i_polygon == null, null, i_polygon.ElectoralArea)

// get the polygon's name
var name = Iif(i_polygon == null, null, i_polygon.ElectoralArea)

// return
return {
    result: {attributes: {
        ElectoralArea: person,
        ElectoralArea: name
    }}
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edit error.JPG" style="width: 456px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60629iCF80C432422C6C4A/image-size/large?v=v2&amp;amp;px=999" role="button" title="edit error.JPG" alt="edit error.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 10:40:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248995#M64324</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-18T10:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248996#M64325</link>
      <description>&lt;P&gt;Both the polygon &amp;amp; the point features are manager connections &amp;amp; I looked at the design of both features &amp;amp; the field's that I'm interested in aren't set to Read Only so not sure why I'm getting the error saying 'Field is not Editable'&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 10:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1248996#M64325</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-18T10:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1249021#M64330</link>
      <description>&lt;P&gt;Hmmm. I tested the rule again, and it works for me. Are you sure that the field "HWDataCollectionPoints.ElectoralArea" is editable?&lt;/P&gt;&lt;P&gt;Can you send me the two feature classes (export them into a new gdb or as shapefiles), either here or in a private message?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 12:52:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1249021#M64330</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-18T12:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1249022#M64331</link>
      <description>&lt;P&gt;ok so I've had some success with the code below which I have added 3 times with 3 rules so that each field is working. The test polygon layer is in the same geodb but the 'real' data lives in 2 different geodb's. I tried to reference by name in the same manner but it says 'can't find the table'.&amp;nbsp; I could move this data so that it all resides in the same geodb but then the data lives in those geodb's for a reason as it's done by datatype. I can't use the getfromportal as the data is sensitive - how can I get around this issue?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// load the other featureset
var fs = FeatureSetByName($datastore, "EnvGIS.ENVMGR.Highway_Officer_AreasPoly")
// get the first feature from fs that intersects the current $feature
var f = First(Intersects(fs, $feature))
// abort if we didn't find something
if(f == null) { return }
// return the intersecting feature's value
return f.HighwaysOfficer&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 13:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1249022#M64331</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-18T13:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1249072#M64338</link>
      <description>&lt;P&gt;I was playing around so moved the data as a test so all in the same geodb. In my test above the field HighwaysOfficer for example was the same in both the point &amp;amp; polygon fc which worked fine. But as you can see in the schema below the point field names are on the left &amp;amp; the polygon names are on the right. I updated the code by returning the field name of the polygon feature at the end of the code but that doesn't work?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="field names.JPG" style="width: 672px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60645i94FFD5300F67F11D/image-size/large?v=v2&amp;amp;px=999" role="button" title="field names.JPG" alt="field names.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 15:14:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1249072#M64338</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-18T15:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Run spatial query when a new feature has been created in a feature layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1249086#M64339</link>
      <description>&lt;P&gt;I managed to get it working in the end by deleting the fields in the point feature, creating them again to match the polygon features &amp;amp; then using those in the code. I'm now going to publish to the portal to see if the rules persist &amp;amp; it works as it does in the Pro Project&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 15:43:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/run-spatial-query-when-a-new-feature-has-been/m-p/1249086#M64339</guid>
      <dc:creator>AndrewReynoldsDevon</dc:creator>
      <dc:date>2023-01-18T15:43:45Z</dc:date>
    </item>
  </channel>
</rss>

