1

Using ArcGIS JavaScript API 3.21 I need to grab all Points on a Server. The code works for me with Query.where clause at

query.where = "FeederID = 'RMT001'";

but as I said I need to get all Points. I tried to run the query without any Query.where statement but not getting back anything. can you please let me know how to get all Points?

 function execute () {
 var query = new Query();
 query.where = "FeederID = 'RMT001'";
 query.returnGeometry = true;
 query.outFields = [ "CreationUser", "FName" ];
 queryTask.execute(query, showResults);
 } 
asked Sep 27, 2017 at 15:58

2 Answers 2

1

The most common way and which should always work (because it's always true) is 1=1.

query.where = "1=1";

Using OBJECTID as suggested in another answer, will not work for all layers, see for example https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/incidents_report/FeatureServer/0/ where the "Object ID field" is called FID.

answered Oct 2, 2017 at 17:36
0

Since you need to get geometries, you can use this query : query.where = "OBJECTID > 0"; Arcgis stores geometries with a unique numerical field

answered Sep 27, 2017 at 20:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.