featureLayer.graphic object attributes

796
2
Jump to solution
03-09-2017 09:31 AM
Alexwang
Occasional Contributor II

Hello, I want to be able to get attribute info from graphics. But I found that the only attribute available for graphics is the OBJECTID (please see the first screen shot) even though I specified the outFields to include the field i want (please see the codes). Did I do anything wrong? Is there a way to get attributes other than OBJECTID from graphics? 

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Alex,

   Are you 100% sure on the field name? CaSe is important. Do you get it if you do:

outFields: ['*']

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Alex,

   Are you 100% sure on the field name? CaSe is important. Do you get it if you do:

outFields: ['*']

0 Kudos
Alexwang
Occasional Contributor II

Thanks Robert. You got me again. I used incorrect layer for the featureLayer. after i used the correct layer with the "PropertyID" field, i was able to get the ProeprtyID listed in the graphic.attributes property. Thanks again. 

0 Kudos