<?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: Getting survey count per site in a list widget - Arcade in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240797#M7104</link>
    <description>&lt;P&gt;Once again, thanks so much&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;! This is what worked:&lt;/P&gt;&lt;P&gt;var ptl = Portal('&lt;A href="https://gisportal...../portal/" target="_blank" rel="noopener"&gt;https://gisportal...../portal/&lt;/A&gt;')&lt;BR /&gt;var fs = FeatureSetByPortalItem(&lt;BR /&gt;ptl,&lt;BR /&gt;'a92f7b3a792........................',&lt;BR /&gt;0,&lt;BR /&gt;['csv_site'],&lt;BR /&gt;false&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;return GroupBy(&lt;BR /&gt;fs, ['csv_site'],&lt;BR /&gt;{name: 'site_count', expression: 'csv_site', statistic: 'COUNT'}&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 13 Dec 2022 21:06:34 GMT</pubDate>
    <dc:creator>ZenMasterZeke</dc:creator>
    <dc:date>2022-12-13T21:06:34Z</dc:date>
    <item>
      <title>Getting survey count per site in a list widget - Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240336#M7090</link>
      <description>&lt;P&gt;Howdy!&lt;/P&gt;&lt;P&gt;I have a feature layer&amp;nbsp; that has a field 'site'. For any one site, there are multiple surveys. For example, Houston, Detroit, Pittsburgh PA. Houston has 10 surveys, Detroit 17, Pittsburgh 13.&lt;/P&gt;&lt;P&gt;I'm trying to add a list of the sites (this itself works ok) along with the survey count for the site (not working). E.g.&lt;BR /&gt;Houston - 10&lt;BR /&gt;Detroit - 17&lt;BR /&gt;Pittsburgh - 13&lt;/P&gt;&lt;P&gt;I've tried various methods to add the count in Arcade and the regular default editor - Count($datapoint.objectid), Count($datapoint.site), Count($datapoint["objectid"]), etc., with no luck. I'd think this would be simple, but maybe I'm the simple one.&lt;/P&gt;&lt;P&gt;Using ArcGIS Enterprise, whatever version is just before 11.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 20:18:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240336#M7090</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2022-12-12T20:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Getting survey count per site in a list widget - Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240344#M7091</link>
      <description>&lt;P&gt;Getting a List to show aggregated features will require a Data Expression. Once a layer hits the List, any Arcade you use is being evaluated per-feature, so the aggregation needs to happen a step earlier. Fortunately, what you're describing here is pretty simple.&lt;/P&gt;&lt;P&gt;You can find a bunch of examples here:&amp;nbsp;&lt;A href="https://github.com/Esri/arcade-expressions/tree/master/dashboard_data" target="_blank"&gt;arcade-expressions/dashboard_data at master · Esri/arcade-expressions (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And here's what this situation might look like specifically.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portal = Portal('https://www.arcgis.com');
var fs = FeatureSetByPortalItem(
    portal,
    'your layer itemid',
    0,
    ['site'],
    false
);

return GroupBy(
    fs,
    'site',
    {name: 'site_count', expression: 1, statistic: 'SUM'}
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 20:34:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240344#M7091</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-12-12T20:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Getting survey count per site in a list widget - Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240734#M7101</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Does this go in the Advanced Formatting section of the List widget? I keep getting the error '&lt;SPAN class=""&gt;Parse Error:&lt;/SPAN&gt;&lt;SPAN&gt;featuresetbyportalitem is not available', and sure enough, the Functions list says that this function is 'Not available'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is running on a state Enterprise Portal where my User Type = Creator, and Role = Publisher. Could this be a permissions issue, an Enterprise configuration issue, something else along those lines, or do I create the expression&amp;nbsp; elsewhere?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for the github link as well, very handy!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 19:17:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240734#M7101</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2022-12-13T19:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting survey count per site in a list widget - Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240736#M7102</link>
      <description>&lt;P&gt;It would be a new layer. When you're selecting the data source for your list, you should be presented with the option to create a new Data Expression. That's where this would go.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1670959151541.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58405iDB4EDC24DF05AE18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1670959151541.png" alt="jcarlson_0-1670959151541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 19:19:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240736#M7102</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-12-13T19:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Getting survey count per site in a list widget - Arcade</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240797#M7104</link>
      <description>&lt;P&gt;Once again, thanks so much&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;! This is what worked:&lt;/P&gt;&lt;P&gt;var ptl = Portal('&lt;A href="https://gisportal...../portal/" target="_blank" rel="noopener"&gt;https://gisportal...../portal/&lt;/A&gt;')&lt;BR /&gt;var fs = FeatureSetByPortalItem(&lt;BR /&gt;ptl,&lt;BR /&gt;'a92f7b3a792........................',&lt;BR /&gt;0,&lt;BR /&gt;['csv_site'],&lt;BR /&gt;false&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;return GroupBy(&lt;BR /&gt;fs, ['csv_site'],&lt;BR /&gt;{name: 'site_count', expression: 'csv_site', statistic: 'COUNT'}&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 21:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/getting-survey-count-per-site-in-a-list-widget/m-p/1240797#M7104</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2022-12-13T21:06:34Z</dc:date>
    </item>
  </channel>
</rss>

