<?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: Arcade expression containing FeatureSet not working in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577244#M10270</link>
    <description>&lt;P&gt;If you wrap the feature set with a &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter" target="_self"&gt;Filter&lt;/A&gt; and the map's definition query you can guarantee the feature count matches the map in every context.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2025 16:43:24 GMT</pubDate>
    <dc:creator>DavidSolari</dc:creator>
    <dc:date>2025-01-20T16:43:24Z</dc:date>
    <item>
      <title>Arcade expression containing FeatureSet not working</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577208#M10268</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have a small Arcade expression I'd like to use in a field map. It takes a feature set from the map, which is filtered from a broader feature service, and generates a "custom" id for any newly added feature.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;POI&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;POI_ID&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;POI&lt;/SPAN&gt;&lt;SPAN&gt; != &lt;/SPAN&gt;&lt;SPAN&gt;null&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;POI&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;"POI "&lt;/SPAN&gt;&lt;SPAN&gt; + (&lt;/SPAN&gt;&lt;SPAN&gt;Count&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Point of Interest"&lt;/SPAN&gt;&lt;SPAN&gt;))+ &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This expression works as intended on ArcGIS Online in the Web Map Viewer. However, when using this expression in the field map, the feature set is not generated in relation to the features on the web map, but the entire feature service itself. So if there are five Points of Interest on the map, but 40 in the feature service, it will generate POI 41 as the POI ID. I've seen others have issues with the FeatureSetByName function in field maps, however none of the solutions seems to particularly pertain to this case. Let me know if anyone has any suggestions, or if this may just be an Esri bug.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Jan 2025 14:52:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577208#M10268</guid>
      <dc:creator>BrianPryzby</dc:creator>
      <dc:date>2025-01-20T14:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression containing FeatureSet not working</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577210#M10269</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/706229"&gt;@BrianPryzby&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would there be any reason where you wouldn't be able to use GUID()?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var POI = $feature.POI_ID
if (POI != null) {
    return POI
} else {
    return "POI-" + GUID()
}&lt;/LI-CODE&gt;&lt;P&gt;This would avoid the FeatureSetByName issue entirely, also generating a unique ID.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/text_functions/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 14:57:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577210#M10269</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-01-20T14:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression containing FeatureSet not working</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577244#M10270</link>
      <description>&lt;P&gt;If you wrap the feature set with a &lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#filter" target="_self"&gt;Filter&lt;/A&gt; and the map's definition query you can guarantee the feature count matches the map in every context.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 16:43:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577244#M10270</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2025-01-20T16:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression containing FeatureSet not working</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577400#M10271</link>
      <description>&lt;P&gt;Thanks David, this worked for me! It seems a bit redundant that you'd need to place a filter on a feature set, which was itself rooted in a filtered layer on a web map. But it is what it is&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 14:12:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577400#M10271</guid>
      <dc:creator>BrianPryzby</dc:creator>
      <dc:date>2025-01-21T14:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression containing FeatureSet not working</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577404#M10272</link>
      <description>&lt;P&gt;Hi Cody, thanks for your response! This definitely would work as a way to generate a unique identifier, though I was looking for something a bit simpler. Just a sequential ID, POI 1, POI 2, etc. that would be unique to each map. There can be repeats within the broader feature layer&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 14:14:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/arcade-expression-containing-featureset-not/m-p/1577404#M10272</guid>
      <dc:creator>BrianPryzby</dc:creator>
      <dc:date>2025-01-21T14:14:47Z</dc:date>
    </item>
  </channel>
</rss>

