<?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: Text box inside Card widget  with Arcade code to count records in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1663791#M21530</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7474"&gt;@JoseSanchez&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can refer to the examples here.&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/advanced-formatting.htm" target="_blank"&gt;https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/advanced-formatting.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ke&lt;/P&gt;</description>
    <pubDate>Thu, 06 Nov 2025 01:20:05 GMT</pubDate>
    <dc:creator>Ke_Xu</dc:creator>
    <dc:date>2025-11-06T01:20:05Z</dc:date>
    <item>
      <title>Text box inside Card widget  with Arcade code to count records</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1663547#M21519</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;I’m looking for a sample that demonstrates how to use Arcade to count records from a hosted feature layer, specifically when connected through Dynamic Content in a text widget. I’m trying to understand how to access the data source and its fields using Arcade.&lt;/P&gt;&lt;P&gt;Essentially, I want to achieve the equivalent of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;COUNT("OBJECTID")&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in Arcade.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2025 14:24:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1663547#M21519</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2025-11-05T14:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Text box inside Card widget  with Arcade code to count records</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1663791#M21530</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7474"&gt;@JoseSanchez&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can refer to the examples here.&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/advanced-formatting.htm" target="_blank"&gt;https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/advanced-formatting.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ke&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2025 01:20:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1663791#M21530</guid>
      <dc:creator>Ke_Xu</dc:creator>
      <dc:date>2025-11-06T01:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Text box inside Card widget  with Arcade code to count records</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1665191#M21596</link>
      <description>&lt;P&gt;Good afternoon&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/766971"&gt;@Ke_Xu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for a way to implement this code from your link:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var ds = $dataSources["dataSource_id"].layer; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var distincItem = Distinct(ds, 'CNTRY_NAME'); return Count(distincItem);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please explain to me how to add this line&amp;nbsp; "var ds = $dataSources["dataSource_id"].layer;" from the default function generated in Experience Builder;? How do I find the dataSource_Id?&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;function&lt;/SPAN&gt; &lt;SPAN&gt;getFilteredFeatureSet&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ds&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I do not understand how to &amp;nbsp;type this line $dataSources["dataSource_id"].layer;&amp;nbsp; in the function generated by Experience Builder.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Documentation: &lt;A href="https://arcg.is/18ejKn3" target="_blank" rel="noopener"&gt;https://arcg.is/18ejKn3&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;function&lt;/SPAN&gt; &lt;SPAN&gt;getFilteredFeatureSet&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ds&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;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&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Nov 2025 17:29:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1665191#M21596</guid>
      <dc:creator>SanchezNuñez</dc:creator>
      <dc:date>2025-11-12T17:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Text box inside Card widget  with Arcade code to count records</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1665227#M21599</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Found it!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;There's no need to declare a function—just typing the code is enough.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;ds&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$dataSources&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;"dataSource_3-1-dataView_1"&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;&lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;v&lt;/SPAN&gt;&lt;SPAN&gt;ar&lt;/SPAN&gt; &lt;SPAN&gt;distincItem&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Distinct&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ds&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN&gt;'OBJECTID'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;Count&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;distincItem&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itWorks_Screenshot 2025-11-12 134404.png" style="width: 683px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/143661i896304D663EBB4C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="itWorks_Screenshot 2025-11-12 134404.png" alt="itWorks_Screenshot 2025-11-12 134404.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Nov 2025 18:46:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/text-box-inside-card-widget-with-arcade-code-to/m-p/1665227#M21599</guid>
      <dc:creator>SanchezNuñez</dc:creator>
      <dc:date>2025-11-12T18:46:25Z</dc:date>
    </item>
  </channel>
</rss>

