<?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 Data Expression Execution Error in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-execution-error/m-p/1123000#M5443</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I'm new to writing data expressions, but not to coding. I followed along with the Data Expressions 101 video&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=rowW2PistiQ" target="_blank"&gt;https://www.youtube.com/watch?v=rowW2PistiQ&lt;/A&gt;&amp;nbsp;And no matter what I do I'm getting an Execution Error. Is there a layer setting that I've missed? The data I'm trying to work with is only shared with my organization. I've tried uploading some dummy data that is set to public, tried as a Feature Layer as well as a WFS. That didn't help either. I was able to pull from some public layers, but none of mine work. Here is a copy of what I've got:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var portal = Portal('https://mygroup.maps.arcgis.com/');
var fcPlaced = FeatureSetByPortalItem(
        portal,
        'my_item_id',
        0,
        ['FC_ID', 'CALCULATEDLENGTH', 'CABLEPLACEDESTIMATED', 'CABLEPLACEDACTUAL'],
        false
);

var fcCombo = {
    'fields': [
        { 'name': 'FC_ID', 'type': 'esriFieldTypeString'},
        { 'name': 'CALCULATEDLENGTH', 'type': 'esriFieldTypeInteger'},
        { 'name': 'CABLEPLACEDESTIMATED', 'type': 'esriFieldTypeDate'},
        { 'name': 'CABLEPLACEDACTUAL', 'type': 'esriFieldTypeDate'}
    ],
    'geometryType': '',
    'features': []
};
console(fcCombo)
var index = 0;
//Loop through and add values
for (var feature in fcPlaced) {
    fcCombo.features[index++] = {
        'attributes': {
            'FC_ID': feature['FC_ID'],
            'CALCULATEDLENGTH': feature['CALCULATEDLENGTH'],
            'CABLEPLACEDESTIMATED': feature['CABLEPLACEDESTIMATED'],
            'CABLEPLACEDACTUAL': feature['CABLEPLACEDACTUAL']
        }
    }
}

return FeatureSet(Text(fcCombo));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Dec 2021 16:43:23 GMT</pubDate>
    <dc:creator>JasonBaker6</dc:creator>
    <dc:date>2021-12-06T16:43:23Z</dc:date>
    <item>
      <title>Data Expression Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-execution-error/m-p/1123000#M5443</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I'm new to writing data expressions, but not to coding. I followed along with the Data Expressions 101 video&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=rowW2PistiQ" target="_blank"&gt;https://www.youtube.com/watch?v=rowW2PistiQ&lt;/A&gt;&amp;nbsp;And no matter what I do I'm getting an Execution Error. Is there a layer setting that I've missed? The data I'm trying to work with is only shared with my organization. I've tried uploading some dummy data that is set to public, tried as a Feature Layer as well as a WFS. That didn't help either. I was able to pull from some public layers, but none of mine work. Here is a copy of what I've got:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var portal = Portal('https://mygroup.maps.arcgis.com/');
var fcPlaced = FeatureSetByPortalItem(
        portal,
        'my_item_id',
        0,
        ['FC_ID', 'CALCULATEDLENGTH', 'CABLEPLACEDESTIMATED', 'CABLEPLACEDACTUAL'],
        false
);

var fcCombo = {
    'fields': [
        { 'name': 'FC_ID', 'type': 'esriFieldTypeString'},
        { 'name': 'CALCULATEDLENGTH', 'type': 'esriFieldTypeInteger'},
        { 'name': 'CABLEPLACEDESTIMATED', 'type': 'esriFieldTypeDate'},
        { 'name': 'CABLEPLACEDACTUAL', 'type': 'esriFieldTypeDate'}
    ],
    'geometryType': '',
    'features': []
};
console(fcCombo)
var index = 0;
//Loop through and add values
for (var feature in fcPlaced) {
    fcCombo.features[index++] = {
        'attributes': {
            'FC_ID': feature['FC_ID'],
            'CALCULATEDLENGTH': feature['CALCULATEDLENGTH'],
            'CABLEPLACEDESTIMATED': feature['CABLEPLACEDESTIMATED'],
            'CABLEPLACEDACTUAL': feature['CABLEPLACEDACTUAL']
        }
    }
}

return FeatureSet(Text(fcCombo));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 16:43:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expression-execution-error/m-p/1123000#M5443</guid>
      <dc:creator>JasonBaker6</dc:creator>
      <dc:date>2021-12-06T16:43:23Z</dc:date>
    </item>
  </channel>
</rss>

