AnsweredAssumed Answered

Editing Feature Layers in Esri JS API 4

Question asked by 96213@charlottenc.gov_charlotte on Aug 13, 2018
Latest reply on Aug 13, 2018 by 96213@charlottenc.gov_charlotte

Hey Team!


I'm struggling with what was an easy workflow in Esri's 3.x JS API -- editing features. 


I've started with the Esri provided sample (ArcGIS API for JavaScript Sandbox) and run into a few hiccups that seemingly stem from the feature layer's source (i.e. adding an item from Portal rather than adding a feature layer directly (difference shown below):


 // add an editable featurelayer from portal
            portalItem: { // autocasts as new PortalItem()
              id: "511b97fc0d364367b127f8ba5c89ad13"


        function addLayer(layer) {
          featureLayer = layer;


        var lineSample = new FeatureLayer({
          url: ""




It appears that the esri sample (first) uses the layer as a callback-promise subsequently and the layer has some 'implicit' properties that get passed, specifically the fields. When using a Feature Layer the only fields I'm seeing when I console.log the hitEvent results are the objectID and the created_user, while the esri sample has all of the layer's attributes.


If someone could point me in the right direction for how to properly define the Feature Layer's schema so that it can be passed into the editor-form, I'd be super appreciative! 


Robert Scheitlin, GISP