AnsweredAssumed Answered

how do I access all attributes in a MapImageLayer SubLayer from PopupTemplate

Question asked by tweber_GCS on Sep 13, 2018
Latest reply on Aug 16, 2019 by jlparra



I have a MapImageLayer (hosted on our portal), with several sublayers. I wish to display some other data in the popup by using a function to return the content (the function is getting called, and I can return what I want). However, the attribute data I need to create/query the other data (non-arcgis data) is not being passed to the content function. The only attribute being sent back is the 'Name' field, and I cannot find a way to set the outFields property for the query that gets run.


 => {
           if (layer.title === 'Some Title') {
             layer.outFields = ["*"]; //<-- does nothing
             layer.sublayers.forEach(subLayer => {
               subLayer.outFields = ["*"]; //<-- also does nothing
               if (subLayer.title === 'hidden layer') {
                 subLayer.visible = false;
               } else if (subLayer.title === 'other layer') {
                   this.otherLayer = subLayer;
               subLayer.popupTemplate = {
                   title: subLayer.title,
                   content: this.getData.bind(this),
                   actions: [{
                     id: subLayer.title,
                     className: 'esri-icon-table',
                     title: 'Dashboard'



getData(evt) {
     console.debug(evt); //<-- only attribute is 'Name'
     console.debug(this.view.popup.viewModel.selectedFeature); //<-- same

There are definitely more attributes on the layer, but only Name is being returned. Am I missing something somewhere in my code to set the outFields for a Portal hosted MapImageLayer? or is there something I need to have changed in the service to return all attributes? thanks!