<?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: FeatureSet Not Returning the Correct Value in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222803#M6370</link>
    <description>&lt;P&gt;Where is the variable "leaks" coming from in this section?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for (var poly in poly_fs){
  var pts = Contains(poly, pt_fs)
  feat = {attributes:
    {
      mmz: zone['ZONE_NAME'],
      number_of_leaks: Count(leaks)
    }
  }
  Push(features,feat)
}&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 18 Oct 2022 14:18:24 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2022-10-18T14:18:24Z</dc:date>
    <item>
      <title>FeatureSet Not Returning the Correct Value</title>
      <link>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222796#M6369</link>
      <description>&lt;P&gt;I'm attempting to create a featureset in ops dashboards to return the number of points contained within a polygon, however I'm getting the same number of points for each polygon.&amp;nbsp; Am I missing something in my data expression? I'm in Enterprise 10.9.1.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChelseaTabor_1-1666100491398.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/53820iA88A3DB8EFC49D54/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChelseaTabor_1-1666100491398.png" alt="ChelseaTabor_1-1666100491398.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var portal = Portal('myportal')&lt;/P&gt;&lt;P&gt;var poly_fs = FeatureSetByPortalItem(portal, 'c879aa9267604224a3f6d492fc997a50', 7,['ZONE_NAME'],true)&lt;/P&gt;&lt;P&gt;var pt_fs = FeatureSetByPortalItem(portal, '44fa0f9330e449c289dfadf2553d805b', 0,['leaktype','leakloss',],true)&lt;/P&gt;&lt;P&gt;var features = []&lt;BR /&gt;var feat&lt;/P&gt;&lt;P&gt;for (var poly in poly_fs){&lt;BR /&gt;var pts = Contains(poly, pt_fs)&lt;BR /&gt;feat = {attributes:{&lt;BR /&gt;mmz: zone['ZONE_NAME'],&lt;BR /&gt;number_of_leaks: Count(leaks)&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;Push(features,feat)&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;var dict = {&lt;BR /&gt;fields:[&lt;BR /&gt;{name:"mmz",alias:"Zone",type:"esriFieldTypeString"},&lt;BR /&gt;{name:"number_of_leaks",alias:"Number of Leaks",type:"esriFieldTypeInteger"}&lt;BR /&gt;],&lt;BR /&gt;geometryType:"",&lt;BR /&gt;features:features&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return FeatureSet(Text(dict))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 13:50:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222796#M6369</guid>
      <dc:creator>ChelseaTabor</dc:creator>
      <dc:date>2022-10-18T13:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSet Not Returning the Correct Value</title>
      <link>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222803#M6370</link>
      <description>&lt;P&gt;Where is the variable "leaks" coming from in this section?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for (var poly in poly_fs){
  var pts = Contains(poly, pt_fs)
  feat = {attributes:
    {
      mmz: zone['ZONE_NAME'],
      number_of_leaks: Count(leaks)
    }
  }
  Push(features,feat)
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Oct 2022 14:18:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222803#M6370</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-10-18T14:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSet Not Returning the Correct Value</title>
      <link>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222804#M6371</link>
      <description>&lt;P&gt;Sorry, that should say '&lt;SPAN&gt;pt_fs'.&amp;nbsp; I changed variable names for this post.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 14:21:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222804#M6371</guid>
      <dc:creator>ChelseaTabor</dc:creator>
      <dc:date>2022-10-18T14:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSet Not Returning the Correct Value</title>
      <link>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222809#M6372</link>
      <description>&lt;P&gt;In that case, you want to get the count of how many point were in the polygon, so it should be&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;number_of_leaks: Count(pts)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 14:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222809#M6372</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-10-18T14:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureSet Not Returning the Correct Value</title>
      <link>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222810#M6373</link>
      <description>&lt;P&gt;That worked. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 14:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/featureset-not-returning-the-correct-value/m-p/1222810#M6373</guid>
      <dc:creator>ChelseaTabor</dc:creator>
      <dc:date>2022-10-18T14:31:09Z</dc:date>
    </item>
  </channel>
</rss>

