<?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 ArcGIS pro Attribute Rules - Intersects in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-intersects/m-p/1138878#M50753</link>
    <description>&lt;P&gt;Good Morning!&lt;/P&gt;&lt;P&gt;After an Enterprise update we switched from using ArcGIS Attribute assistant to the new arcGIS pro Attribute Rules. I'm trying to adapt rules that we already had in attribute assistant into attribute rules. Admittedly, I'm working on strengthening my arcade but I feel like this should be easy so I'm not sure what I'm doing wrong and wanted to see if any of you fine people could help.&lt;/P&gt;&lt;P&gt;I'm working with a parcel fabric, but what I am trying to do is to do an intersect between a parcel that is new or edited, intersect that with a zip code layer that lies within the same map as the parcels, and return the zip code to the parcel. i have looked through a lot of the Esri documentation and have come up with the code below. but get an error when I try to implement it.&lt;BR /&gt;&lt;BR /&gt;Current code i have in arcade is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var geom2 = Polygon({ZipCodes});&lt;BR /&gt;first( Intersects($layer, geom2) );&lt;BR /&gt;Return Zipcodes.ZIPCODE&lt;BR /&gt;&lt;BR /&gt;Am I missing something? it seems to be what i would think is easy but have had no luck yet. Thanks in advance with the help!&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jan 2022 14:05:29 GMT</pubDate>
    <dc:creator>MichaelDeliberato</dc:creator>
    <dc:date>2022-01-31T14:05:29Z</dc:date>
    <item>
      <title>ArcGIS pro Attribute Rules - Intersects</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-intersects/m-p/1138878#M50753</link>
      <description>&lt;P&gt;Good Morning!&lt;/P&gt;&lt;P&gt;After an Enterprise update we switched from using ArcGIS Attribute assistant to the new arcGIS pro Attribute Rules. I'm trying to adapt rules that we already had in attribute assistant into attribute rules. Admittedly, I'm working on strengthening my arcade but I feel like this should be easy so I'm not sure what I'm doing wrong and wanted to see if any of you fine people could help.&lt;/P&gt;&lt;P&gt;I'm working with a parcel fabric, but what I am trying to do is to do an intersect between a parcel that is new or edited, intersect that with a zip code layer that lies within the same map as the parcels, and return the zip code to the parcel. i have looked through a lot of the Esri documentation and have come up with the code below. but get an error when I try to implement it.&lt;BR /&gt;&lt;BR /&gt;Current code i have in arcade is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var geom2 = Polygon({ZipCodes});&lt;BR /&gt;first( Intersects($layer, geom2) );&lt;BR /&gt;Return Zipcodes.ZIPCODE&lt;BR /&gt;&lt;BR /&gt;Am I missing something? it seems to be what i would think is easy but have had no luck yet. Thanks in advance with the help!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 14:05:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-intersects/m-p/1138878#M50753</guid>
      <dc:creator>MichaelDeliberato</dc:creator>
      <dc:date>2022-01-31T14:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS pro Attribute Rules - Intersects</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-intersects/m-p/1138914#M50758</link>
      <description>&lt;P&gt;There are a few issues in the expression you've shared.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Polygon &lt;/STRONG&gt;is for creating a single polygon feature from a JSON definition, and does not have other attributes. To get another layer of features that is not in your parcel fabric, you should use &lt;STRONG&gt;FeatureSetByPortalItem&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Calling &lt;STRONG&gt;First(Intersects(...))&lt;/STRONG&gt; will return something, but unless you store that result in a var, you have no way of further accessing its properties.&lt;/LI&gt;&lt;LI&gt;Attribute rules have &lt;A href="https://developers.arcgis.com/arcade/guide/profiles/#attribute-rules" target="_self"&gt;a slightly different profile&lt;/A&gt;, and there is no "$map" global, so having the zip codes "in the same map" doesn't really matter.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Intersects&lt;/STRONG&gt; needs at least one single feature as one of the parameters. Attribute rules fire at the feature level, so using "$feature" instead of "$layer" will work.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portal = Portal('your-url')

var zips = FeatureSetByPortalItem(
    portal,
    'item-id-of-zips-layer',
    0, // Or whatever layer index your zips are in
    ['ZIPCODE'],
    true
)

var first_zip = First(Intersects($feature, zips))

return first_zip['ZIPCODE']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also worth considering: if your parcels and zips don't align perfectly, there may be situations in which a tiny sliver of a zip code is caught by the intersection, and it mistakenly gets returned by &lt;STRONG&gt;first&lt;/STRONG&gt;. If it's an issue, you can try something like taking the &lt;STRONG&gt;centroid&lt;/STRONG&gt; of the feature before intersecting it with your zip codes.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 15:02:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-intersects/m-p/1138914#M50758</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-01-31T15:02:49Z</dc:date>
    </item>
  </channel>
</rss>

