<?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: Data Expressions in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628895#M11264</link>
    <description>&lt;P&gt;Remove line 50&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jul 2025 14:36:35 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2025-07-01T14:36:35Z</dc:date>
    <item>
      <title>Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628635#M11257</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I have created a Dashboard on my Portal. The layers I am referencing for the Dashboard are found in a map which is also included in the portal. I need to create a Table Widget that pulls field from two different layers within the map. I am attempting to use a Data Expression to retrieve the data from the two layers. I am just beginning to learn Arcade but I am pretty sure I am on the right track with the expression below; however, no matter how many times I have tried to correct an syntax errors within the expression I allows receive a message stating stating "Unable to execute the Arcade Script". I can't even get a simple expression to work.&lt;/P&gt;&lt;P&gt;1. Are there any specific permissions on the Portal that need to be enable to use Data Expressions withing a dashboard?&lt;/P&gt;&lt;P&gt;Here is the current expression. I am pulling from two layer 'Ownership Parcels' and 'Site Boundary'. From the 'Ownership Parcels' layer I need the following fields: 'COST_CENTER', 'Name', and 'CalculatedAcre'. From the 'Site Boundary' layer I need the these two field: 'Name' and 'COST_CENTER'. 'COST_CENTER' is the field that will link the two layers. Any advice would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Connect to the same portal as your dashboard&lt;BR /&gt;var portal = Portal("&lt;A href="https://some.portal.college.edu/portal" target="_blank" rel="noopener"&gt;https://some.portal.college.edu/portal&lt;/A&gt;")&lt;/P&gt;&lt;P&gt;// Shared item ID for both layers&lt;BR /&gt;var itemId = "4b1aefe40a8847bab37217a36688dfbf"&lt;/P&gt;&lt;P&gt;// Ownership Parcels (Layer 24)&lt;BR /&gt;var parcels = FeatureSetByPortalItem(&lt;BR /&gt;portal, itemId, 24,&lt;BR /&gt;["Name", "CalculatedArea", "COST_CENTER"]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;// Site Boundary (Layer 57)&lt;BR /&gt;var sites = FeatureSetByPortalItem(&lt;BR /&gt;portal, itemId, 57,&lt;BR /&gt;["Name", "COST_CENTER"]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;// Define table schema&lt;BR /&gt;var fields = [&lt;BR /&gt;{ name: "Parcel_Name", type: "esriFieldTypeString" },&lt;BR /&gt;{ name: "Calculated_Area", type: "esriFieldTypeDouble" },&lt;BR /&gt;{ name: "Parcel_COST_CENTER", type: "esriFieldTypeString" },&lt;BR /&gt;{ name: "Site_Name", type: "esriFieldTypeString" },&lt;BR /&gt;{ name: "Site_COST_CENTER", type: "esriFieldTypeString" }&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;// List of output features&lt;BR /&gt;var features = []&lt;/P&gt;&lt;P&gt;// Intersect parcels with sites and build output table&lt;BR /&gt;for (var parcel in parcels) {&lt;BR /&gt;for (var site in sites) {&lt;BR /&gt;if (Intersects(parcel, site)) {&lt;BR /&gt;Push(features, {&lt;BR /&gt;attributes: {&lt;BR /&gt;Parcel_Name: parcel["Name"],&lt;BR /&gt;Calculated_Area: parcel["CalculatedArea"],&lt;BR /&gt;Parcel_COST_CENTER: parcel["COST_CENTER"],&lt;BR /&gt;Site_Name: site["Name"],&lt;BR /&gt;Site_COST_CENTER: site["COST_CENTER"]&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Return result (dictionary structure — required by Dashboards)&lt;BR /&gt;return {&lt;BR /&gt;fields: fields,&lt;BR /&gt;geometryType: "",&lt;BR /&gt;features: features&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2025 20:50:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628635#M11257</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2025-06-30T20:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628656#M11258</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/191945"&gt;@Lebowski&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you're working through the arcade, what I would do is slowly work through the program, stopping at each line and hitting check/verify/run to make sure that each step is working.&lt;/P&gt;&lt;P&gt;First I would verify that you have permissions to view the layer, and also have a creator license to create the dashboards, next, I would try running this to verify you can connect:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portal = Portal("https://some.portal.college.edu/portal")

var itemId = "4b1aefe40a8847bab37217a36688dfbf"&lt;/LI-CODE&gt;&lt;P&gt;If everything works out, I would then try to move onto this part here and add it on:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var parcels = FeatureSetByPortalItem(
portal, itemId, 24,
["Name", "CalculatedArea", "COST_CENTER"]
)&lt;/LI-CODE&gt;&lt;P&gt;Continuing this process should isolate your issue, let me know if this ends up working for you!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2025 21:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628656#M11258</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-06-30T21:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628820#M11259</link>
      <description>&lt;P&gt;You have to return a FeatureSet from a Data Expression to use in an element. Try using this as your return&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return FeatureSet({ fields: fields, features: features });&lt;/LI-CODE&gt;&lt;P&gt;Also, when posting code, please use the &lt;A href="https://community.esri.com/t5/python-blog/code-formatting-the-community-version/ba-p/1007633#U1007633" target="_self"&gt;Insert/Edit code sample&lt;/A&gt; button&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 12:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628820#M11259</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-07-01T12:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628865#M11260</link>
      <description>&lt;LI-CODE lang="c"&gt;var portal = Portal("https://some.portal.college.edu/portal")

var itemId = "4b1aefe40a8847bab37217a36688dfbf"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Jul 2025 14:01:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628865#M11260</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2025-07-01T14:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628870#M11261</link>
      <description>&lt;P&gt;So when I add the expression above everything is still red and the return I get is 'null"&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 14:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628870#M11261</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2025-07-01T14:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628886#M11262</link>
      <description>&lt;LI-CODE lang="c"&gt;// Connect to the same portal as your dashboard
var portal = Portal("https://some.portal.college.edu/portal")

// Shared item ID for both layers
var itemId = "7712f75bdb7246d9b6c56f2c9e029dbe"

// Ownership Parcels (Layer 24)
var parcels = FeatureSetByPortalItem(
portal, itemId, 24,
["Name", "CalculatedArea", "COST_CENTER"]
)

// Site Boundary (Layer 57)
var sites = FeatureSetByPortalItem(
portal, itemId, 57,
["Name", "COST_CENTER"]
)

// Define table schema
var fields = [
{ name: "Parcel_Name", type: "esriFieldTypeString" },
{ name: "Calculated_Area", type: "esriFieldTypeDouble" },
{ name: "Parcel_COST_CENTER", type: "esriFieldTypeString" },
{ name: "Site_Name", type: "esriFieldTypeString" },
{ name: "Site_COST_CENTER", type: "esriFieldTypeString" }
]

// List of output features
var features = []

// Intersect parcels with sites and build output table
for (var parcel in parcels) {
for (var site in sites) {
if (Intersects(parcel, site)) {
Push(features, {
attributes: {
Parcel_Name: parcel["Name"],
Calculated_Area: parcel["CalculatedArea"],
Parcel_COST_CENTER: parcel["COST_CENTER"],
Site_Name: site["Name"],
Site_COST_CENTER: site["COST_CENTER"]
}
})
}
}
}

// Return result (dictionary structure — required by Dashboards)
return FeatureSet({ fields: fields, features: features });
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Jul 2025 14:20:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628886#M11262</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2025-07-01T14:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628887#M11263</link>
      <description>&lt;P&gt;Here is my updated expression, still unable to execute. In the Arcade Playground my output says "&lt;SPAN&gt;Test execution error: Unexpected token '}'.. Verify test data."&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 14:22:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628887#M11263</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2025-07-01T14:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628895#M11264</link>
      <description>&lt;P&gt;Remove line 50&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 14:36:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628895#M11264</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-07-01T14:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628916#M11265</link>
      <description>&lt;P&gt;Output from Playground&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Arcade_Playground.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/135519i894F40914CE50ACE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Arcade_Playground.jpg" alt="Arcade_Playground.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 15:19:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628916#M11265</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2025-07-01T15:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628923#M11266</link>
      <description>&lt;P&gt;If you have a lot of of sites and parcels, this expression will take a long time to calculate. To see how it's progressing through the parcels loop, put this Console statement at line 32&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Console(parcel.name);&lt;/LI-CODE&gt;&lt;P&gt;and check the Console tab.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 15:26:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628923#M11266</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-07-01T15:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628932#M11267</link>
      <description>&lt;P&gt;Like this? Thank you for all your help!&lt;/P&gt;&lt;LI-CODE lang="c"&gt;for (var parcel in parcels) {Console(parcel.name)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 01 Jul 2025 15:45:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628932#M11267</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2025-07-01T15:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628933#M11268</link>
      <description>&lt;P&gt;I am still seeing the stuck circled. Also do I need to Intersect the parcels (see line 31). I really just want to join the 'Site Boundary' table to the 'Ownership Parcels' table.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2025 15:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions/m-p/1628933#M11268</guid>
      <dc:creator>Lebowski</dc:creator>
      <dc:date>2025-07-01T15:49:03Z</dc:date>
    </item>
  </channel>
</rss>

