<?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: FeaturSetByName formula not working with hosted feature layers in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1564319#M90778</link>
    <description>&lt;P&gt;So the item id is found in the features url and the layer id is simply the number that is found at the end of the url. Most of the time, if it is a single published layer, the item id is 0.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 20:10:26 GMT</pubDate>
    <dc:creator>RPGIS</dc:creator>
    <dc:date>2024-12-03T20:10:26Z</dc:date>
    <item>
      <title>FeaturSetByName formula not working with hosted feature layers</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1563787#M90709</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Was wondering if anyone &lt;STRONG&gt;&lt;U&gt;&lt;EM&gt;has worked on field calculations (In Arcade Expressions) on hosted feature layers in ArcGIS Pro&lt;/EM&gt;&lt;/U&gt;&lt;/STRONG&gt;. I wanted to grab the the field value of a polygon layer that intersects another and transfer that value over into the other layers field. I have used the following formula:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CCFF"&gt;// load the point featureclass&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;var&lt;/FONT&gt; points = &lt;FONT color="#00FF00"&gt;FeatureSetByName&lt;/FONT&gt;(&lt;FONT color="#339966"&gt;$datastore&lt;/FONT&gt;, &lt;FONT color="#FF6600"&gt;"Shelter_Zones"&lt;/FONT&gt;, [&lt;FONT color="#FF6600"&gt;"*"&lt;/FONT&gt;], &lt;FONT color="#3366FF"&gt;true&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CCFF"&gt;// get the points inside the current polygon feature&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;var&lt;/FONT&gt; points_in_polygon = &lt;FONT color="#00FF00"&gt;Contains&lt;/FONT&gt;(&lt;FONT color="#339966"&gt;$feature&lt;/FONT&gt;, points)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#99CCFF"&gt;// count them and return the number&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;return&lt;/FONT&gt; &lt;FONT color="#00FF00"&gt;Count&lt;/FONT&gt;(points_in_polygon)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was successful in running this feature when they were native layers created in ArcGIS Pro but cannot get it to run with hosted feature layers. I get the following error:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;EM&gt;Invalid expression.&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&lt;EM&gt;Error on line 2.&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;&lt;EM&gt;Table not found Shelter_Zones&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I read somewhere that is has to do with first parameter after the function&amp;nbsp;&lt;FONT color="#00FF00"&gt;&lt;EM&gt;FeatureSetByName&lt;/EM&gt;&lt;/FONT&gt;. I am assuming this is where the formula is referencing the origin point for the data. My guess is that &lt;FONT color="#339966"&gt;$datastore&lt;/FONT&gt; is saying the values are held in ArcGIS Pro when they are not. I have tried &lt;FONT color="#339966"&gt;$map&lt;/FONT&gt; with no success either.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Has anyone else run into this issue and if so how they you guys resolve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 18:51:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1563787#M90709</guid>
      <dc:creator>Strata_ChrisG</dc:creator>
      <dc:date>2024-12-02T18:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: FeaturSetByName formula not working with hosted feature layers</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1563791#M90711</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/857307"&gt;@Strata_ChrisG&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You would need to utilize the &lt;A href="https://developers.arcgis.com/arcade/function-reference/portal_functions/" target="_blank"&gt;Portal functions | ArcGIS Arcade | Esri Developer&lt;/A&gt; for hosted/feature services. You first get the portal, followed by the item id, and the layer index of the item( the order from which the service was published).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 19:02:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1563791#M90711</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2024-12-02T19:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: FeaturSetByName formula not working with hosted feature layers</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1564146#M90763</link>
      <description>&lt;P&gt;HI&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/22623"&gt;@RPGIS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for pointing me in the right direction! By chance do you know where to find the layer index of the item or "layerid"? I was able to the item id from the url of the layer site but cannot find the layer id?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, does this formula work with AGOL hosted feature layers as well or only Portal (Enterprise) items?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 16:51:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1564146#M90763</guid>
      <dc:creator>Strata_ChrisG</dc:creator>
      <dc:date>2024-12-03T16:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: FeaturSetByName formula not working with hosted feature layers</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1564288#M90775</link>
      <description>&lt;P&gt;I&amp;nbsp; ran the formula as:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#33CCCC"&gt;var &lt;/FONT&gt;p = &lt;FONT color="#339966"&gt;Portal&lt;/FONT&gt;("&lt;FONT color="#FF6600"&gt;https://********.maps.arcgis.com&lt;/FONT&gt;");&lt;BR /&gt;&lt;FONT color="#33CCCC"&gt;var&lt;/FONT&gt; features = &lt;FONT color="#339966"&gt;FeatureSetByPortalItem&lt;/FONT&gt;(p, "&lt;FONT color="#FF6600"&gt;itemid&lt;/FONT&gt;",layerid);&lt;/P&gt;&lt;P&gt;But I get:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;Invalid expression.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Error on line 2.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;Object not found "layer name"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I was able to get the &lt;STRONG&gt;&lt;U&gt;&lt;EM&gt;item id&lt;/EM&gt;&lt;/U&gt;&lt;/STRONG&gt; from the layer page in my organizations &lt;EM&gt;AGOL&lt;/EM&gt; page and grabbed the &lt;STRONG&gt;&lt;EM&gt;&lt;U&gt;layer id&lt;/U&gt;&lt;/EM&gt;&lt;/STRONG&gt; from copying the features path (in the table of contents) in &lt;EM&gt;ArcGIS Pro&lt;/EM&gt; and then opening it in notepad on my desktop.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks again for the help!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 19:32:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1564288#M90775</guid>
      <dc:creator>Strata_ChrisG</dc:creator>
      <dc:date>2024-12-03T19:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: FeaturSetByName formula not working with hosted feature layers</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1564319#M90778</link>
      <description>&lt;P&gt;So the item id is found in the features url and the layer id is simply the number that is found at the end of the url. Most of the time, if it is a single published layer, the item id is 0.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 20:10:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/featursetbyname-formula-not-working-with-hosted/m-p/1564319#M90778</guid>
      <dc:creator>RPGIS</dc:creator>
      <dc:date>2024-12-03T20:10:26Z</dc:date>
    </item>
  </channel>
</rss>

