Hi,
I'm trying to convert a dictionary to a FeatureSet in an Arcade data Expression. Everything works well until I use a Date field.
The following works ok, just inserting null values for the date field
var data_dict = {
'fields': [
{'name': 'EditDate','type': 'esriFieldTypeDate'},
{'name': 'country','type': 'esriFieldTypeString'},
{'name': 'status','type': 'esriFieldTypeInteger'}
],
'geometryType':'',
'features': []
};
for (var i=0; i < 10;i++) {
data_dict.features[i] = {
'attributes': {
'EditDate': null,
'country': 'NL',
'status': 230
}
}
}
Console(data_dict)
var fs = FeatureSet(Text(data_dict))
return fs
It results in a FeatureSet with empty values for the date field and all other field filled.
However, if I try Now() or Text(Now(),"YYYY-MM-DD") or Timestamp() or just a date like string '2021-04-14' :
var data_dict = {
'fields': [
{'name': 'EditDate','type': 'esriFieldTypeDate'},
{'name': 'country','type': 'esriFieldTypeString'},
{'name': 'status','type': 'esriFieldTypeInteger'}
],
'geometryType':'',
'features': []
};
for (var i=0; i < 10;i++) {
data_dict.features[i] = {
'attributes': {
'EditDate': Now(),
'country': 'NL',
'status': 230
}
}
}
Console(data_dict)
var fs = FeatureSet(Text(data_dict))
return fs
I end up with an empty Featureset
Any ideas?
Regards,
Marc