Hello,
I am trying to get work an Arcade expression to create a FeatureSet, which I want to use then for Serial chart.
In simplification, I am taking an attribute ZONE from the layer:
var fs = FeatureSetByPortalItem(Portal('https://arcgis.com'),'e7ad315d17a742fda44fb63cd311152a',0,['ZONE'], false)
The ZONE attribute is a string which looks like P6-0176. The goal is to create a field in the FeatureSet which recalculate the ZONE filed but keeps the first two chars only - so the result for this example would be P6.
So I am creating a new FeatureSet definition, and the attribute ZONE I would like to use in LEFT function.
But if I use the code like this:
var novy = {
'fields': [{'name':'Zona', 'type':'esriFieldTypeString'}],
'geometryType': '',
'features':
[{'attributes':
{'Zona': Left((fs,'ZONE'), 2)
}}]};
return FeatureSet(Text(novy))
The result is the error for the LEFT function.
What is the correct syntax to call the column ZONE from the original FeatureSet FS in the LEFT function? Or is there any other way (and this is not the correct one) how to recalculate the ZONE attribute in original FeatureSet FS.
Thank you for any ideas