Hello! I am trying to create a data expression to populate a list in dashboards that reflects all the features of an existing featureset, but with a specific buffer around them. Mainly, I'm just not sure where in feature's attributes I can access/change the geometry and I'm having a hard time finding documentation about it. I currently have it on line 27 in the code below -- but I'm honestly not sure if that is where it would go OR if that would be the correct key to use.
var agol = portal('https://www.arcgis.com')
var layer = FeatureSetByPortalItem(agol,'0ca544f09ff94130b2685fbcbb7f89f1');
var recalc = {
'fields': [{'name':'Name', 'type':'esriFieldTypeString'},
{'name':'objectid','type':'esriFieldTypeOID'},
{'name':'globalid','type':'esriFieldTypeGlobalID'},
{'name':'Type','type':'esriFieldTypeString'},
{'name':'Status','type':'esriFieldTypeString'},
{'name':'Date','type':'esriFieldTypeDate'},
// {'name':'search_date','type':'esriFieldTypeDate'}
],
'geometryType': '',
'features': []
}
for (var a in layer) {
var new_a = {'attributes':{
'Name':a.Name,
'objectid':a.OBJECTID,
'globalid':a.GLOBALID,
'Type':a.Type,
'Status':a.Status,
'Date':a.Date,
},
geometry:Buffer(Geometry(a),50,'miles')
}
Push(recalc.features, new_a)
}
return FeatureSet(Text(recalc))
Solved! Go to Solution.
Well -- I solved my own problem and it actually does work for filtering and such on the map...but I'll keep it here in case someone else wants to see how I did it!
Well -- I solved my own problem and it actually does work for filtering and such on the map...but I'll keep it here in case someone else wants to see how I did it!