How to read the attribute table from a feature layer?

1077
3
11-29-2013 02:08 AM
by Anonymous User
Not applicable
Original User: Greforb

How do I read the attribute table from a feature layer using javascript? Do I have to query the features and look in the graphics or can I avoid having to look in the graphics and just get a table with attributes? I want to create a drop down from unique values in one of the fields in the attribute table. I currently did this using FeatureLayer.queryFeatures, but apparently this only returns 1000 features. I tried to increase this number in my arcgisonline hosted feature service without any luck. When I look in my https://services1.arcgis.com/xxx/arcgis/admin under Services (as told elsewhere on this or another forum, can't remember) I am told that there are no services, hence I cannot increase the number of features return by querying! Also I guess that performance will be poor if I increase this value. So ideally I want to avoid querying and just retrieve the full attribute list without geometry attached to it. Then I can run through that and produce the list I need.
0 Kudos
3 Replies
by Anonymous User
Not applicable
Original User: stevel

I guess that performance will be poor if I increase this value. So ideally I want to avoid querying and just retrieve the full attribute list without geometry attached to it. Then I can run through that and produce the list I need.


There is definitely a setting which allows you to increase the number - have a play around on the panel in ArcMap when you create the ArcGIS Server service definition. (I don't have ArcMap handy to do a test).

However, you're right that it will slow the performance down if you need to read through thousands of records when populating your dropdown.

Instead, what about summarizing the values in ArcMap, then creating a table from the summarized version, and using this for the dropdown? With any luck you'll have fewer than 1000 unique values (if not, increase the number as above).

Steve
0 Kudos
ReneRubalcava
Frequent Contributor
If you want to get hacky, you can use the 'returnDistinctValues' in the query as described here.http://forums.arcgis.com/threads/95739-Why-isn-t-quot-returnDistinctValues-quot-an-option-for-the-qu...

This will limit the result to distinct results. Works well when returning a single field from a request.
0 Kudos
by Anonymous User
Not applicable
Original User: stevel

use the 'returnDistinctValues' in the query as described here.http://forums.arcgis.com/threads/95739-Why-isn-t-quot-returnDistinctValues-quot-an-option-for-the-qu...


Nice one - do that!
0 Kudos