I'm trying to get the geometry in an array from a queryTask using the Esri JavaScript API v4.7. I'm sure I'm missing something but I dont know what. I want to take geometry from this to then create a new record in another service.
require([
"esri/tasks/QueryTask",
"esri/tasks/support/Query"
],
function(
QueryTask,
Query
){
var LayerUrl = "https://services8.arcgis.com/R1PAHHLiCM5plgJt/arcgis/rest/services/MICC_Planning/FeatureServer/0";
var queryTask = new QueryTask({
url: LayerUrl
});
var lotp="15MPH7941";
var q="Lotplan LIKE '"+lotp+"'";
var query = new Query();
query.returnGeometry = true;
query.outFields = ["*"];
query.where = q;
queryTask.execute(query).then(function(results){
console.log(4);
window.alert(results.features.geometry);
});
// When resolved, returns a count of the features that satisfy the query.
queryTask.executeForCount(query).then(function(results){
console.log(results);
});
});