AnsweredAssumed Answered

feature.attributes syntax

Question asked by KeitherJ on Jan 30, 2015
Latest reply on Jan 30, 2015 by KeitherJ



I have some feature results coming back from a queryTask to populate a grid.

This return gives me the correct data


var data =, function (feature) {

return { "id": feature.attributes["OBJECTID"],  

         "NAME": feature.attributes["PARCELID"]




but I would like just the first two fields without explicitly naming them.

Something like this?


return { "id": feature.attributes[outFields[0]],                 

          "NAME": feature.attributes[outFields[1]]



Just can't get it.

Any syntax suggestions?