<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Query from Geometry in Web Component Sketch object returns no results in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-from-geometry-in-web-component-sketch-object/m-p/1654698#M87679</link>
    <description>&lt;P&gt;When I try to query data from a sketch on a particular layer, it never returns any results when I know they exist.&amp;nbsp; This used to work for the older Sketch object, but it no longer works with the web component sketch object.&lt;/P&gt;&lt;P&gt;First I get the geometry from the sketch and I can see it has values in the geometry property&lt;/P&gt;&lt;P&gt;sketchGeometry = event.detail.graphics[0].geometry;&lt;/P&gt;&lt;P&gt;Then after I get the layer view I do the following to try and query the attribues from that layer:&lt;/P&gt;&lt;P&gt;view.whenLayerView(layerSketchFrom).then((layerView)&amp;nbsp;&lt;/P&gt;&lt;P&gt;const query = parcelLayerView.layer.createQuery({&lt;BR /&gt;geometry: geometry,&lt;BR /&gt;outFields: ["*"],&lt;BR /&gt;spatialRelationship: "contains",&lt;BR /&gt;returnGeometry: true&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;parcelLayerView.queryFeatures(query).then(async (results) =&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I look into the results variable, no results ever come back.&amp;nbsp; This used to work perfectly before, so I'm very confused why the new object doesn't work like the old one.&lt;/P&gt;&lt;P&gt;Can someone please provide an example of how to properly query a layer using the geometry from the new web component sketch object?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Oct 2025 13:46:33 GMT</pubDate>
    <dc:creator>dtstopper</dc:creator>
    <dc:date>2025-10-02T13:46:33Z</dc:date>
    <item>
      <title>Query from Geometry in Web Component Sketch object returns no results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-from-geometry-in-web-component-sketch-object/m-p/1654698#M87679</link>
      <description>&lt;P&gt;When I try to query data from a sketch on a particular layer, it never returns any results when I know they exist.&amp;nbsp; This used to work for the older Sketch object, but it no longer works with the web component sketch object.&lt;/P&gt;&lt;P&gt;First I get the geometry from the sketch and I can see it has values in the geometry property&lt;/P&gt;&lt;P&gt;sketchGeometry = event.detail.graphics[0].geometry;&lt;/P&gt;&lt;P&gt;Then after I get the layer view I do the following to try and query the attribues from that layer:&lt;/P&gt;&lt;P&gt;view.whenLayerView(layerSketchFrom).then((layerView)&amp;nbsp;&lt;/P&gt;&lt;P&gt;const query = parcelLayerView.layer.createQuery({&lt;BR /&gt;geometry: geometry,&lt;BR /&gt;outFields: ["*"],&lt;BR /&gt;spatialRelationship: "contains",&lt;BR /&gt;returnGeometry: true&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;parcelLayerView.queryFeatures(query).then(async (results) =&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I look into the results variable, no results ever come back.&amp;nbsp; This used to work perfectly before, so I'm very confused why the new object doesn't work like the old one.&lt;/P&gt;&lt;P&gt;Can someone please provide an example of how to properly query a layer using the geometry from the new web component sketch object?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 13:46:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-from-geometry-in-web-component-sketch-object/m-p/1654698#M87679</guid>
      <dc:creator>dtstopper</dc:creator>
      <dc:date>2025-10-02T13:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Query from Geometry in Web Component Sketch object returns no results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-from-geometry-in-web-component-sketch-object/m-p/1654818#M87684</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/700759"&gt;@dtstopper&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Take a look at the &lt;A href="https://developers.arcgis.com/javascript/latest/tutorials/query-a-feature-layer-spatial/" target="_self"&gt;Query a feature layer spatial&lt;/A&gt; tutorial or this &lt;A href="https://codepen.io/sagewall/pen/xbZEQMZ?editors=1000" target="_self"&gt;codepen&lt;/A&gt;, which is the solution from the tutorial.&amp;nbsp; Hopefully they will help.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 14:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-from-geometry-in-web-component-sketch-object/m-p/1654818#M87684</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2025-10-02T14:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Query from Geometry in Web Component Sketch object returns no results</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-from-geometry-in-web-component-sketch-object/m-p/1654955#M87688</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;, once I figured out that I had to create the event handler for the sketch tool before call&amp;nbsp;arcgisMap.viewOnReady(), it worked with the example you gave me.&amp;nbsp; I also had to add my layers after the&amp;nbsp;arcgisMap.viewOnReady() function was completed.&lt;/P&gt;&lt;P&gt;Thank you again for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Oct 2025 18:34:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-from-geometry-in-web-component-sketch-object/m-p/1654955#M87688</guid>
      <dc:creator>dtstopper</dc:creator>
      <dc:date>2025-10-02T18:34:10Z</dc:date>
    </item>
  </channel>
</rss>

