You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue
When creating a feature layer from an in memory source (array of graphics), version 4.22 of the JS API will throw an error when using a field with a parenthesis in it (ex: "st_length(shape)").
Expected behavior
It is expected that this field would be supported as this field is a valid field that can be published from ArcGIS Server.
If you change the ArcGIS version to 4.21, then it will not throw an error. If you comment out the st_length(shape) field (in the 4.22 version), then the example will work (pointing to that field being the issue).
constlayer=newFeatureLayer({id: "4535209429701526",title: "USA - Highways",source: graphics,visibility: true,objectIdField: "objectid",geometryType: 'polyline',fields: [{alias: "OBJECTID",editable: true,length: -1,name: "objectid",nullable: true,type: "oid"},// Comment out the following field and it will work.// If you change to version 4.21 it will work with this field.{alias: "st_length(shape)",// <----------------- THE PROBLEM FIELDeditable: true,length: -1,name: "st_length(shape)",nullable: true,type: "double"}],spatialReference: {latestWkid: 4326,wkid: 4326}});map.add(layer);});
The text was updated successfully, but these errors were encountered:
rustygreen
changed the title
🐞 Bug: FeatureLayer fields with parenthesis fail (w/ in memory data)
🐞 Bug: FeatureLayer fields with parenthesis fail (w/ in memory data) (4.22)
Feb 16, 2022
The issue
When creating a feature layer from an in memory source (array of graphics), version 4.22 of the JS API will throw an error when using a field with a parenthesis in it (ex:
"st_length(shape)"
).Expected behavior
It is expected that this field would be supported as this field is a valid field that can be published from ArcGIS Server.
Reproduce the issue
The bug can be demonstrated in the following codepen example:
https://codepen.io/rustygreen/pen/dyZZXMY?editors=1001
If you change the ArcGIS version to 4.21, then it will not throw an error. If you comment out the
st_length(shape)
field (in the 4.22 version), then the example will work (pointing to that field being the issue).The text was updated successfully, but these errors were encountered: