Why does my Rest Query to my Feature Service return only one field value and the geometry?

1910
4
Jump to solution
09-20-2019 01:48 PM
TheKenerson
Occasional Contributor

Hi,

   I am using a rest query on my feature service. I am entering an object id and it returns only one field value and the geometry.

   How do I get more fields? And why, why, why is this confusing? This should be the simplest thing ever. lol.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ChristianWells
Esri Regular Contributor

Adding on to Randy's comment...are you specifying the outFields variable to show the field you want returned?

Query (Feature Service/Layer)—ArcGIS REST API: Services Directory | ArcGIS for Developers  

There is an option to use a wildcard (outFields=*) or specify each field (outFields=AREANAME,ST,POP2000) individually.

View solution in original post

4 Replies
RandyBurton
MVP Alum

Without seeing the actual query you are using, I assume you are specifying a specific object id number in your where clause ( OBJECTID = 123 ) which would only return one record.  You can remove any reference to the object id in your where clause to retrieve all records; or use greater than or less than to get a group of rows ( OBJECTID > 0 ). 

ChristianWells
Esri Regular Contributor

Adding on to Randy's comment...are you specifying the outFields variable to show the field you want returned?

Query (Feature Service/Layer)—ArcGIS REST API: Services Directory | ArcGIS for Developers  

There is an option to use a wildcard (outFields=*) or specify each field (outFields=AREANAME,ST,POP2000) individually.

TheKenerson
Occasional Contributor

Yes! I forgot about outfields! Thank you Christian. I'm amazed at what i can forget! This was really frustrating for me the other day! I knew it had to be something basic i was forgetting. Thanks again!

0 Kudos
ChristianWells
Esri Regular Contributor

I'm happy I could help!

0 Kudos