<?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: Related Records in Dashboard Data Expression in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/related-records-in-dashboard-data-expression/m-p/1076290#M4754</link>
    <description>&lt;P&gt;Create a VIEW instead&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jul 2021 14:50:56 GMT</pubDate>
    <dc:creator>RobertBorchert</dc:creator>
    <dc:date>2021-07-07T14:50:56Z</dc:date>
    <item>
      <title>Related Records in Dashboard Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/related-records-in-dashboard-data-expression/m-p/1075256#M4748</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am working to build a data expression that pulls an attribute from a related table. I am not seeing any global variables :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CANCAndrewJohnsonGISS_0-1625247312793.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17621i0FAD6AA987846CF1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CANCAndrewJohnsonGISS_0-1625247312793.png" alt="CANCAndrewJohnsonGISS_0-1625247312793.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And when I filter to create a new featureset object, I cannot access its attributes within a for loop like I can when I use the unfiltered feature sets. Does anyone have some example code of this process?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;// Write an expression that returns a FeatureSet.
// Documentation: https://arcg.is/3c419TD

//var plots = FeatureSetByPortalItem(Portal('https://geoplatform.maps.arcgis.com'), '88cf338d4ace40c099fe17fdab889537', '0')
var Char = FeatureSetByPortalItem(Portal('https://geoplatform.maps.arcgis.com'), '88cf338d4ace40c099fe17fdab889537', '5')
var SoilPit = FeatureSetByPortalItem(Portal('https://geoplatform.maps.arcgis.com'), '88cf338d4ace40c099fe17fdab889537', '15')
Console(Char)
var choicesDict = {
    fields:[
        { name: "SoilKey", type: "esriFieldTypeString" },
        { name: "Texture", type: "esriFieldTypeString" },
        { name: "HorizonKey", type: "esriFieldTypeString" },
        { name: "Office", type: "esriFieldTypeString" },
    ],
    'geometryType': '',
    'features':[]
};
var i = 0;

for (var feature in SoilPit){
    var Soil_Key = feature["SoilKey"]
    Console(Soil_Key)
    var filter_query = "PrimaryKey" + " ='" + Soil_Key + "'";
    Console("filter query",filter_query)
    var officeFS = Filter(Char,filter_query)
    
    Console(officeFS)
    for (var f in officeFS){
        choicesDict.features[i] = {
        attributes: {
        SoilKey: feature["SoilKey"],
        Texture: feature["Texture"],
        HorizonKey: feature["HorizonKey"],
        Office: f.Office,
        },
      };
      i++;    
        
    }
    
    
}

return FeatureSet(Text(choicesDict))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 17:47:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/related-records-in-dashboard-data-expression/m-p/1075256#M4748</guid>
      <dc:creator>CANC-AndrewJohnsonGISS</dc:creator>
      <dc:date>2021-07-02T17:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Related Records in Dashboard Data Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/related-records-in-dashboard-data-expression/m-p/1076290#M4754</link>
      <description>&lt;P&gt;Create a VIEW instead&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 14:50:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/related-records-in-dashboard-data-expression/m-p/1076290#M4754</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2021-07-07T14:50:56Z</dc:date>
    </item>
  </channel>
</rss>

