<?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 Trouble creating a data expression for survey feature layer within ArcGIS Dashboard. in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/trouble-creating-a-data-expression-for-survey/m-p/1637051#M11311</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a dashboard that will monitor travel locations using Survey123. The survey contains repeats just in case respondents travel to multiple countries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not well versed in Arcade, but I am trying to create a data expression that takes a layer/table with a GlobalID. Finds related records in a child table/layer with a field ParentGlobalID then matches that GlobalID. From there, its returns related data so you can use it in a Dashboard element (list, chart, etc.).&lt;/P&gt;&lt;P&gt;I keep running into an issue where it can't find the $datastore. I have the web map set up correctly, but it keeps giving me an error saying "&lt;SPAN&gt;Test execution error: Compilation error - Line : 1,7 Identifier not recognized. Verify test data."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;// Get parent layer (Survey)
var parentLayer = FeatureSetByName($datastore, "Form_1", ["GlobalID"], false)

// Get repeat layer (child)
var repeatLayer = FeatureSetByName($datastore, "Travel Locations", ["ParentGlobalID", "Select the country You will be traveling to", "OBJECTID"], false)

// Empty array for results
var relatedRepeats = []

// Loop through parents
for (var parent in parentLayer) {
    var parentID = parent["GlobalID"]
    
    // Find repeat features where ParentGlobalID matches this parent
    var repeats = Filter(
        repeatLayer,
        "ParentGlobalID = @parentID"
    )
    
    // Add all matching repeats to results
    for (var r in repeats) {
        Push(relatedRepeats, r)
    }
}

// Return repeats as FeatureSet
return FeatureSet(Text(relatedRepeats))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2025 18:51:48 GMT</pubDate>
    <dc:creator>DanielRutigliano</dc:creator>
    <dc:date>2025-07-28T18:51:48Z</dc:date>
    <item>
      <title>Trouble creating a data expression for survey feature layer within ArcGIS Dashboard.</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/trouble-creating-a-data-expression-for-survey/m-p/1637051#M11311</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a dashboard that will monitor travel locations using Survey123. The survey contains repeats just in case respondents travel to multiple countries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not well versed in Arcade, but I am trying to create a data expression that takes a layer/table with a GlobalID. Finds related records in a child table/layer with a field ParentGlobalID then matches that GlobalID. From there, its returns related data so you can use it in a Dashboard element (list, chart, etc.).&lt;/P&gt;&lt;P&gt;I keep running into an issue where it can't find the $datastore. I have the web map set up correctly, but it keeps giving me an error saying "&lt;SPAN&gt;Test execution error: Compilation error - Line : 1,7 Identifier not recognized. Verify test data."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help is appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;// Get parent layer (Survey)
var parentLayer = FeatureSetByName($datastore, "Form_1", ["GlobalID"], false)

// Get repeat layer (child)
var repeatLayer = FeatureSetByName($datastore, "Travel Locations", ["ParentGlobalID", "Select the country You will be traveling to", "OBJECTID"], false)

// Empty array for results
var relatedRepeats = []

// Loop through parents
for (var parent in parentLayer) {
    var parentID = parent["GlobalID"]
    
    // Find repeat features where ParentGlobalID matches this parent
    var repeats = Filter(
        repeatLayer,
        "ParentGlobalID = @parentID"
    )
    
    // Add all matching repeats to results
    for (var r in repeats) {
        Push(relatedRepeats, r)
    }
}

// Return repeats as FeatureSet
return FeatureSet(Text(relatedRepeats))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 18:51:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/trouble-creating-a-data-expression-for-survey/m-p/1637051#M11311</guid>
      <dc:creator>DanielRutigliano</dc:creator>
      <dc:date>2025-07-28T18:51:48Z</dc:date>
    </item>
  </channel>
</rss>

