Select to view content in your preferred language

In arcgis 4.13, it is not returning all attributes for a feature layer if we check the graphic.attributes of the layer. how can we able to load all attributes

979
2
Jump to solution
12-04-2019 03:24 AM
reneeshtk
New Contributor

I am using a esri-react package and when I tried to access layer field values from graphic.attributes objects, it shows only two fields in it. objectid and the display field. in 4.10 there was all attributes. how can I get all attributes loaded?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Reneesh,

   Sounds like you have not set the layer outFields property in the constructor then.

Set this property to include the fields that will be used for client-side queries if the fields are not part of required fields used for rendering.

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Reneesh,

   Sounds like you have not set the layer outFields property in the constructor then.

Set this property to include the fields that will be used for client-side queries if the fields are not part of required fields used for rendering.

reneeshtk
New Contributor

you are correct, when I added the outfields it worked. 

map.allLayers.forEach(layer => {
if(layer.type == 'feature') {
layer.outFields = ['*'];
}
});
0 Kudos