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);
}
2 Answers 2
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.
Since you need to get geometries, you can use this query :
query.where = "OBJECTID > 0";
Arcgis stores geometries with a unique numerical field
Explore related questions
See similar questions with these tags.