<?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 Re: EditorWidget applyEdits not automatically querying newly created feature in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editorwidget-applyedits-not-automatically-querying/m-p/1638530#M87462</link>
    <description>&lt;P&gt;As workaround I tried to simply query the new feature during interceptor after part:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const creationSuccessfulInterceptor: __esri.RequestInterceptor = {
    urls: layerUrls,
    after: async (response) =&amp;gt; {
        // iterate over response.data + response.data[].addResults
        // take the layerId from data and take the objectId from addResults
        const objectIdByLayerIdMap = this.retrieveObjectIdsAndLayerId(response);
        
        // get the layer object
        const layer = this.retrieveLayerFromView(objectIdByLayerIdMap);
        
        // query new features from that layer
        layer.queryFeatures({objectIds: objectIds});
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;But only querying it did not bring it visible. Am I missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What works better is to just refresh the full layer. But instead of a single smooth feature query, many geometry queries are performed returning all current visible features of that layer.&lt;BR /&gt;At least the new Feature is shown now!&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// call refresh instead querying a single feature
layer.refresh();&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_0-1754076570923.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137740iFBE66EBFCF4B1229/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_0-1754076570923.png" alt="SebastianKrings_0-1754076570923.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I still hope for better ideas to clarify whether there is a bug in applyEdits or how to get it working correctly without the need of an interceptor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2025 19:31:55 GMT</pubDate>
    <dc:creator>SebastianKrings</dc:creator>
    <dc:date>2025-08-01T19:31:55Z</dc:date>
    <item>
      <title>EditorWidget applyEdits not automatically querying newly created feature</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editorwidget-applyedits-not-automatically-querying/m-p/1638332#M87457</link>
      <description>&lt;P&gt;&lt;STRONG&gt;TL;DR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My problem is, that after creating a feature in the EditorWidget the Feature is not shown in the map. It is not queried. In another identical ap (clone) but different deployment it works just fine.&lt;/P&gt;&lt;P&gt;You can find a table about differences below.&lt;/P&gt;&lt;P&gt;What am I missing and how do I fix it or work around?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Long Version&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In our app (called B) we are using a simple EditorWidget:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const mapView = await this._mapViewPromise;
this._activeEditor = new Editor({
    view: mapView,
    container: this.canvasId
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After drawing and typing data into the form and clicking so save it, the Feature is created.&lt;BR /&gt;But: Its not visible until I refresh the whole page.&lt;BR /&gt;Checking the network tab shows, that there is no query sent to retrieve the created feature.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_0-1754055004502.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137658i1C7C38A8A04D4BAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_0-1754055004502.png" alt="SebastianKrings_0-1754055004502.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After pressing F5, all Features appear:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_1-1754055251838.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137659i188CEFDBBA4AC44C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_1-1754055251838.png" alt="SebastianKrings_1-1754055251838.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;payload of applyEdits &lt;STRONG&gt;with adds-object nested in edits-object&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_6-1754056318979.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137665i67AF03FD8DBD290E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_6-1754056318979.png" alt="SebastianKrings_6-1754056318979.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Since we copied the app code from another app (called A) and modified some other things I tried the same there and:&lt;BR /&gt;The other app immediately is showing the new feature and I can see a query in the network tab.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_4-1754055730138.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137663i8298B74270B5ABF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_4-1754055730138.png" alt="SebastianKrings_4-1754055730138.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;payload of applyEdits &lt;STRONG&gt;with adds-object&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_7-1754056446878.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137666iD8C31CAB6C9B232B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_7-1754056446878.png" alt="SebastianKrings_7-1754056446878.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So both apps, being clones but used in different deployments do different things.&lt;/P&gt;&lt;P&gt;What are the differences I recognize so far?&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt; (clon of A)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;automatically queries the new Feature&lt;/TD&gt;&lt;TD width="50%"&gt;no query after applyEdits&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;thus shows new feature on map directly&lt;/TD&gt;&lt;TD width="50%"&gt;F5 needed to show new Features&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;uses a hosted FeatureService from its own ArcGIS Portal&lt;/TD&gt;&lt;TD width="50%"&gt;uses a FeaturesService from its own ArcGIS Portal but connected to Enterprise GeoDB (so not shown as "hosted" in the portal)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;directy uses 'adds'-object in payload&lt;/TD&gt;&lt;TD width="50%"&gt;nests the 'adds'-object inside an 'edits'-object also containing nested 'edits' and 'deletes' with null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;RequestURL:&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://myA.local/server1/rest/services/Hosted/MyAService/FeatureServer/2/applyEdits" target="_blank" rel="noopener"&gt;https://myA.local/server1/rest/services/Hosted/MyAService/FeatureServer/2/applyEdits&lt;/A&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;RequestURL:&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://shgdi-myB.local/server/rest/services/myB/MyBService/FeatureServer/applyEdits" target="_blank" rel="noopener"&gt;https://shgdi-myB.local/server/rest/services/myB/MyBService/FeatureServer/applyEdits&lt;/A&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Layers are added like map.add(new WFSLayer(props)&lt;/TD&gt;&lt;TD width="50%"&gt;Layers added automatically via WebMap:&lt;BR /&gt;const map = new WebMap(...)&lt;BR /&gt;new MapView(..., map, ....)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Regarding the different request URL I found these two different docs about applyEdits:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/apply-edits-feature-service/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/rest/services-reference/enterprise/apply-edits-feature-service/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/apply-edits-feature-service-layer/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/rest/services-reference/enterprise/apply-edits-feature-service-layer/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;It seems that when applyEdits on FeaturesServer does not run the query afterwards while the applyEdits on FeatureServer/Layer does.&lt;BR /&gt;&lt;BR /&gt;Since I am out of ideas I am wondering whether:&lt;BR /&gt;- this is a bug in FeatureServer-applyEdits&lt;BR /&gt;- this is intended for some reason&lt;BR /&gt;- it is due to some different configuration (like a flag to decide to not to run the query afterwards).&lt;/P&gt;&lt;P&gt;Any ideas and info are welcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 14:40:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editorwidget-applyedits-not-automatically-querying/m-p/1638332#M87457</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2025-08-01T14:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: EditorWidget applyEdits not automatically querying newly created feature</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editorwidget-applyedits-not-automatically-querying/m-p/1638530#M87462</link>
      <description>&lt;P&gt;As workaround I tried to simply query the new feature during interceptor after part:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const creationSuccessfulInterceptor: __esri.RequestInterceptor = {
    urls: layerUrls,
    after: async (response) =&amp;gt; {
        // iterate over response.data + response.data[].addResults
        // take the layerId from data and take the objectId from addResults
        const objectIdByLayerIdMap = this.retrieveObjectIdsAndLayerId(response);
        
        // get the layer object
        const layer = this.retrieveLayerFromView(objectIdByLayerIdMap);
        
        // query new features from that layer
        layer.queryFeatures({objectIds: objectIds});
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;But only querying it did not bring it visible. Am I missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What works better is to just refresh the full layer. But instead of a single smooth feature query, many geometry queries are performed returning all current visible features of that layer.&lt;BR /&gt;At least the new Feature is shown now!&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// call refresh instead querying a single feature
layer.refresh();&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SebastianKrings_0-1754076570923.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137740iFBE66EBFCF4B1229/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SebastianKrings_0-1754076570923.png" alt="SebastianKrings_0-1754076570923.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I still hope for better ideas to clarify whether there is a bug in applyEdits or how to get it working correctly without the need of an interceptor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2025 19:31:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editorwidget-applyedits-not-automatically-querying/m-p/1638530#M87462</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2025-08-01T19:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: EditorWidget applyEdits not automatically querying newly created feature</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editorwidget-applyedits-not-automatically-querying/m-p/1641041#M87500</link>
      <description>&lt;P&gt;We just found out, that this behaviour also appears within ExperienceBuilderApps. Using the editor widget does not show the Feature unless one forces a query by either reloading or heavy zooming.&lt;/P&gt;&lt;P&gt;Guess thats a BUG though.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2025 19:21:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/editorwidget-applyedits-not-automatically-querying/m-p/1641041#M87500</guid>
      <dc:creator>SebastianKrings</dc:creator>
      <dc:date>2025-08-11T19:21:23Z</dc:date>
    </item>
  </channel>
</rss>

