How to extract attribute values when identifying features in Javascript API 3.x

214
2
Jump to solution
03-15-2019 08:56 AM
DanielSchatt
New Contributor III

hi all, I need to a extract the value for a particular field in a feature layer when a user clicks on a given feature.  I don't need to display the field value in a popup but just to use that value elsewhere in my code. 

I'm assuming I need to define a feature layer but not sure on the rest.  

I see examples extracting field values using a (feature layer).on { } event listener and then displaying the values in a popup with this "$" notation.  But I don't think this is what I'm looking for.

I also see there's a QueryTask object that returns a FeatureSet and presumably I can extract the value from that, but I can't find an example that shows the precise syntax.  

Appreciate any help, thanks!

Dan

0 Kudos
1 Solution

Accepted Solutions
EvelynHernandez
Regular Contributor

Hey, check this example.

Query data without a map | ArcGIS API for JavaScript 3.27 

So instead of making a popup u can get the parameters easily with the for sentence over there.

I hope this help u

View solution in original post

0 Kudos
2 Replies
EvelynHernandez
Regular Contributor

Hey, check this example.

Query data without a map | ArcGIS API for JavaScript 3.27 

So instead of making a popup u can get the parameters easily with the for sentence over there.

I hope this help u

0 Kudos
DanielSchatt
New Contributor III

Thanks Evelyn, I overlooked this, hopefully it's what I need!