AnsweredAssumed Answered

How to use Query() to pull intersecting features through a widget

Question asked by Stahly on Feb 17, 2017
Latest reply on Feb 20, 2017 by Stahly

How does one correctly use a query and QueryTask to retrieve features in a predefined layer that intersect a selected feature?

 

var queryTask = new QueryTask("http://services6.arcgis.com/3aTanasiPG0rbYg4/arcgis/rest/services/PlatBook_Test/FeatureServer/1");
var query = new Query();
query.returnGeometry = true;
query.outFields = ["SECDIVID"];
query.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
// execute query
queryTask.execute(query);

 

current piece of code spits out an error of faulty query arguments.

Once the query works the next task will be to output a specific field from the output into an array.

 

Any help is appreciated, I'm very new to writing scripts and have no idea what I'm doing.

Cheers!

Outcomes