Retrieve Unique Values from feature layers

13763
11
Jump to solution
05-07-2015 11:08 AM
RyanSmith1
New Contributor III

Hi Guys, i need to retrieve unique values from a set of feature layers. I've been using the following example as a guideline - Using JavaScript to populate a ComboBox with unique values | ArcGIS Blog but my problem as noted in that article is that the records i have is over 500, 2500 to be exact. I came across a certain "returnDistinctValues" property from the Query API Reference - Query | API Reference | ArcGIS API for JavaScript which if set to true will return distinct Values of the specified outfields of the query. I haven't tried out as yet since it requires "supportsAdvancedQueries" property of the feature layer to be set to true and the current configuration has it set to false. 

I do recognize that changing the maxRecord of the feature layer could severely hamper the performance, so the only other option i can think of using the queryIds method of the feature layer?

Please advise as to which approach i should take to overcome this issue.

Thanks,

Ryan

11 Replies
RyanSmith1
New Contributor III

Thanks guys!

I really appreciate your help on this topic. I've merged both approaches into one solution for my application.

Thanks again

Regards,

Ryan

0 Kudos
DougBrowning
MVP Esteemed Contributor

Anyone have any ideas on how to do this in the ArcMap query builder.  Say I want to set a definition query on a Feature Service - if I click Get Unique values I can not get a full list due to it being a FS.  Seems like ArcMap does not use a distinct call.

thanks

0 Kudos