<?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 Dashboard data expression issue with Date fields in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-issue-with-date-fields/m-p/1599003#M10933</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am creating a data expression in dashboard, trying to convert data fields (from Central Time to UTC). When I look at the individual features, it's working, everything looks like I want it. However, when I push to the featureset to be used in a table , ALL the date fields have the same values...&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portal = Portal('https://www.arcgis.com');
var fs = FeatureSetByPortalItem(
    portal,
    '1b32fd673de04b16b15bf5a923b7d1fb',
    0,
    [
        'dr_DateTime',
        'dr_DateText'
    ],
    false
);

// return fs
     
var features = [];
var feat;

// Populate feature array
for (var f in fs) { 
    feat = { 
        'attributes': { 
            'dr_DateTimeMd': ChangeTimeZone(f['dr_DateTime'],"+06:00"), 
            'dr_DateTimeF': f['dr_DateTime'],
            'dr_DateTimeUTCF': ToUTC(f['dr_DateTime']),
            'dr_DateTextF': f['dr_DateText'] 
        }}
    Push(features, feat);
};

// return features

var dowDict = { 
  'fields': [
  {'name': 'dr_DateTimeMd', 'type': 'esriFieldTypeDate'},
  {'name': 'dr_DateTimeF', 'type': 'esriFieldTypeDate'}, 
  {'name': 'dr_DateTimeUTCF', 'type': 'esriFieldTypeDate'}, 
  {'name': 'dr_DateTextF', 'type': 'esriFieldTypeString'}
  ], 
  'geometryType': '', 
  'features': features
}; 

// Convert dictionary to feature set. 
var fs_dict = FeatureSet(dowDict); 

return fs_dict&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;raw featureset&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRobergeIADOT_0-1742914523140.png" style="width: 342px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128623i97C5AC3EED077A36/image-dimensions/342x222?v=v2" width="342" height="222" role="button" title="DominicRobergeIADOT_0-1742914523140.png" alt="DominicRobergeIADOT_0-1742914523140.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each individual features:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRobergeIADOT_1-1742914564322.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128624i97C0D45890B40BE6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DominicRobergeIADOT_1-1742914564322.png" alt="DominicRobergeIADOT_1-1742914564322.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Final featureset&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRobergeIADOT_2-1742914589773.png" style="width: 641px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128625i2A5F27A833D87E7C/image-dimensions/641x202?v=v2" width="641" height="202" role="button" title="DominicRobergeIADOT_2-1742914589773.png" alt="DominicRobergeIADOT_2-1742914589773.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Mar 2025 14:58:03 GMT</pubDate>
    <dc:creator>DominicRobergeIADOT</dc:creator>
    <dc:date>2025-03-25T14:58:03Z</dc:date>
    <item>
      <title>Dashboard data expression issue with Date fields</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-issue-with-date-fields/m-p/1599003#M10933</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I am creating a data expression in dashboard, trying to convert data fields (from Central Time to UTC). When I look at the individual features, it's working, everything looks like I want it. However, when I push to the featureset to be used in a table , ALL the date fields have the same values...&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portal = Portal('https://www.arcgis.com');
var fs = FeatureSetByPortalItem(
    portal,
    '1b32fd673de04b16b15bf5a923b7d1fb',
    0,
    [
        'dr_DateTime',
        'dr_DateText'
    ],
    false
);

// return fs
     
var features = [];
var feat;

// Populate feature array
for (var f in fs) { 
    feat = { 
        'attributes': { 
            'dr_DateTimeMd': ChangeTimeZone(f['dr_DateTime'],"+06:00"), 
            'dr_DateTimeF': f['dr_DateTime'],
            'dr_DateTimeUTCF': ToUTC(f['dr_DateTime']),
            'dr_DateTextF': f['dr_DateText'] 
        }}
    Push(features, feat);
};

// return features

var dowDict = { 
  'fields': [
  {'name': 'dr_DateTimeMd', 'type': 'esriFieldTypeDate'},
  {'name': 'dr_DateTimeF', 'type': 'esriFieldTypeDate'}, 
  {'name': 'dr_DateTimeUTCF', 'type': 'esriFieldTypeDate'}, 
  {'name': 'dr_DateTextF', 'type': 'esriFieldTypeString'}
  ], 
  'geometryType': '', 
  'features': features
}; 

// Convert dictionary to feature set. 
var fs_dict = FeatureSet(dowDict); 

return fs_dict&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;raw featureset&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRobergeIADOT_0-1742914523140.png" style="width: 342px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128623i97C5AC3EED077A36/image-dimensions/342x222?v=v2" width="342" height="222" role="button" title="DominicRobergeIADOT_0-1742914523140.png" alt="DominicRobergeIADOT_0-1742914523140.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each individual features:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRobergeIADOT_1-1742914564322.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128624i97C0D45890B40BE6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DominicRobergeIADOT_1-1742914564322.png" alt="DominicRobergeIADOT_1-1742914564322.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Final featureset&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DominicRobergeIADOT_2-1742914589773.png" style="width: 641px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128625i2A5F27A833D87E7C/image-dimensions/641x202?v=v2" width="641" height="202" role="button" title="DominicRobergeIADOT_2-1742914589773.png" alt="DominicRobergeIADOT_2-1742914589773.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2025 14:58:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-issue-with-date-fields/m-p/1599003#M10933</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2025-03-25T14:58:03Z</dc:date>
    </item>
  </channel>
</rss>

