Hello
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...
What am I doing wrong?
Thanks!
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
raw featureset
Each individual features:
Final featureset