<?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 Feature Table editing wrong feature when sorted in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-editing-wrong-feature-when-sorted/m-p/1140541#M76255</link>
    <description>&lt;P&gt;Brand new to Javascript so I'm hoping I'm missing something simple here, but I have a very simple page cloned from the feature table with editing enabled sample code but swapped out my own feature layer. For the most part it works great but if I tell the table to sort on a column, it will select the correct feature but push updates to a different one.&lt;/P&gt;&lt;P&gt;Here's where I select the record, I see the correct feature highlight.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JasonJordan00_0-1643920386369.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33068i0BB6A5DE48E74703/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JasonJordan00_0-1643920386369.png" alt="JasonJordan00_0-1643920386369.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the status field in the same record updates a different location.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JasonJordan00_1-1643920469071.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33070iAD5208377DDD26D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JasonJordan00_1-1643920469071.png" alt="JasonJordan00_1-1643920469071.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This only happens if I include direction: "asc" in one of the field configurations. Assuming there is a place for me to identify the objectid?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my page for reference. Thanks everyone&lt;/P&gt;&lt;P&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta charset="utf-8" /&amp;gt;&lt;BR /&gt;&amp;lt;meta&lt;BR /&gt;name="viewport"&lt;BR /&gt;content="initial-scale=1, maximum-scale=1,user-scalable=no"&lt;BR /&gt;/&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;&lt;BR /&gt;FeatureTable widget with editing enabled | Sample | ArcGIS API for&lt;BR /&gt;JavaScript 4.22&lt;BR /&gt;&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;link&lt;BR /&gt;rel="stylesheet"&lt;BR /&gt;href="&lt;A href="https://js.arcgis.com/4.22/esri/themes/light/main.css" target="_blank"&gt;https://js.arcgis.com/4.22/esri/themes/light/main.css&lt;/A&gt;"&lt;BR /&gt;/&amp;gt;&lt;BR /&gt;&amp;lt;script src="&lt;A href="https://js.arcgis.com/4.22/" target="_blank"&gt;https://js.arcgis.com/4.22/&lt;/A&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;html,&lt;BR /&gt;body {&lt;BR /&gt;height: 100%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;margin: 0;&lt;BR /&gt;padding: 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;#viewDiv {&lt;BR /&gt;height: 50%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.container {&lt;BR /&gt;height: 50%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;require([&lt;BR /&gt;"esri/Map",&lt;BR /&gt;"esri/views/MapView",&lt;BR /&gt;"esri/layers/FeatureLayer",&lt;BR /&gt;"esri/widgets/FeatureTable",&lt;BR /&gt;"esri/widgets/Editor"&lt;BR /&gt;], (Map, MapView, FeatureLayer, FeatureTable,Editor) =&amp;gt; {&lt;BR /&gt;let featureLayer;&lt;BR /&gt;const features = [];&lt;/P&gt;&lt;P&gt;const map = new Map({&lt;BR /&gt;basemap: "streets-navigation-vector"&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: map,&lt;BR /&gt;center: [-95.75,29.18],&lt;BR /&gt;zoom: 7,&lt;BR /&gt;popup: {&lt;BR /&gt;autoOpenEnabled: false&lt;BR /&gt;} //disable popups&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;view.when(() =&amp;gt; {&lt;BR /&gt;featureLayer = new FeatureLayer({&lt;BR /&gt;// URL to the service&lt;BR /&gt;url: "&lt;A href="https://xxxxxxxxxxxxxxxxx/FeatureServer/0" target="_blank"&gt;https://xxxxxxxxxxxxxxxxx/FeatureServer/0&lt;/A&gt;",&lt;BR /&gt;outFields: ["*"],&lt;BR /&gt;title: "Emergency Reporting Areas"&lt;BR /&gt;});&lt;BR /&gt;map.add(featureLayer);&lt;/P&gt;&lt;P&gt;// Create the feature table&lt;BR /&gt;const featureTable = new FeatureTable({&lt;BR /&gt;view: view,&lt;BR /&gt;layer: featureLayer,&lt;BR /&gt;editingEnabled: true,&lt;BR /&gt;menuConfig: {&lt;BR /&gt;items: [&lt;BR /&gt;{&lt;BR /&gt;label: "Zoom to feature(s)",&lt;BR /&gt;iconClass: "esri-icon-zoom-in-magnifying-glass",&lt;BR /&gt;clickFunction: (event) =&amp;gt; {&lt;BR /&gt;zoomToSelectedFeature();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;// Autocast the FieldColumnConfigs&lt;BR /&gt;fieldConfigs: [&lt;BR /&gt;{&lt;BR /&gt;name: "name",&lt;BR /&gt;label: "Area Name",&lt;BR /&gt;editable: false,&lt;BR /&gt;direction: "asc"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "type",&lt;BR /&gt;label: "Type",&lt;BR /&gt;editable: false,&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "boilwater",&lt;BR /&gt;label: "Boil Water Notice?"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "evacuation",&lt;BR /&gt;label: "Evacuation Status"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "poweroutage",&lt;BR /&gt;label: "Power Outage?"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "highwater",&lt;BR /&gt;label: "High Water?"&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;container: document.getElementById("tableDiv")&lt;BR /&gt;});&lt;BR /&gt;const polyInfos = {&lt;BR /&gt;layer: featureLayer,&lt;BR /&gt;label:"name",&lt;BR /&gt;updateEnabled: false,&lt;BR /&gt;formTemplate: {&lt;BR /&gt;// autocasts to FormTemplate&lt;BR /&gt;elements: [&lt;BR /&gt;{&lt;BR /&gt;// autocasts to FieldElement&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "name",&lt;BR /&gt;label: "Area"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "type",&lt;BR /&gt;label: "Type"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "poweroutage",&lt;BR /&gt;label: "Power Outage"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "boilwater",&lt;BR /&gt;label: "Boil Water?"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "evacuation",&lt;BR /&gt;label: "Evacuation Status"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;const editor = new Editor({&lt;BR /&gt;view: view,&lt;BR /&gt;&lt;BR /&gt;layerInfos: [polyInfos],&lt;BR /&gt;// It is possible to set snapping via the API by directly setting SnappingOptions in the Editor. This can also be toggled on/off using the CTRL key. By default snapping is not enabled, setting enabled to true toggles this.&lt;BR /&gt;snappingOptions: {&lt;BR /&gt;// Autocastable to snapping options&lt;BR /&gt;enabled: true, // sets the global snapping option that controls both geometry constraints (self-snapping) and feature snapping.&lt;BR /&gt;featureSources: [&lt;BR /&gt;{&lt;BR /&gt;// Autocastable to FeatureSnappingLayerSource&lt;BR /&gt;// Enable feature snapping on specified layer(s)&lt;BR /&gt;layer: featureLayer&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;// Get the FeatureLayer's layerView and listen for the table's selection-change event&lt;BR /&gt;featureTable.on("selection-change", (changes) =&amp;gt; {&lt;BR /&gt;// If the selection is removed, remove the feature from the array&lt;BR /&gt;changes.removed.forEach((item) =&amp;gt; {&lt;BR /&gt;const data = features.find((data) =&amp;gt; {&lt;BR /&gt;return data.feature === item.feature;&lt;BR /&gt;});&lt;BR /&gt;if (data) {&lt;BR /&gt;features.splice(features.indexOf(data), 1);&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// If the selection is added, push all added selections to array&lt;BR /&gt;changes.added.forEach((item) =&amp;gt; {&lt;BR /&gt;const feature = item.feature;&lt;BR /&gt;features.push({&lt;BR /&gt;feature: feature&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;view.ui.add(editor, "top-right");&lt;BR /&gt;function zoomToSelectedFeature() {&lt;BR /&gt;// Create a query off of the feature layer&lt;BR /&gt;const query = featureLayer.createQuery();&lt;BR /&gt;// Iterate through the features and grab the feature's objectID&lt;BR /&gt;const featureIds = features.map((result) =&amp;gt; {&lt;BR /&gt;return result.feature.getAttribute(featureLayer.objectIdField);&lt;BR /&gt;});&lt;BR /&gt;// Set the query's objectId&lt;BR /&gt;query.objectIds = featureIds;&lt;BR /&gt;// Make sure to return the geometry to zoom to&lt;BR /&gt;query.returnGeometry = true;&lt;BR /&gt;// Call queryFeatures on the feature layer and zoom to the resulting features&lt;BR /&gt;featureLayer.queryFeatures(query).then((results) =&amp;gt; {&lt;BR /&gt;view.goTo(results.features).catch((error) =&amp;gt; {&lt;BR /&gt;if (error.name !== "AbortError") {&lt;BR /&gt;console.error(error);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;BR /&gt;&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div class="container"&amp;gt;&lt;BR /&gt;&amp;lt;div id="tableDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 20:38:25 GMT</pubDate>
    <dc:creator>JasonJordan00</dc:creator>
    <dc:date>2022-02-03T20:38:25Z</dc:date>
    <item>
      <title>Feature Table editing wrong feature when sorted</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-editing-wrong-feature-when-sorted/m-p/1140541#M76255</link>
      <description>&lt;P&gt;Brand new to Javascript so I'm hoping I'm missing something simple here, but I have a very simple page cloned from the feature table with editing enabled sample code but swapped out my own feature layer. For the most part it works great but if I tell the table to sort on a column, it will select the correct feature but push updates to a different one.&lt;/P&gt;&lt;P&gt;Here's where I select the record, I see the correct feature highlight.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JasonJordan00_0-1643920386369.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33068i0BB6A5DE48E74703/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JasonJordan00_0-1643920386369.png" alt="JasonJordan00_0-1643920386369.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing the status field in the same record updates a different location.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JasonJordan00_1-1643920469071.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/33070iAD5208377DDD26D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JasonJordan00_1-1643920469071.png" alt="JasonJordan00_1-1643920469071.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This only happens if I include direction: "asc" in one of the field configurations. Assuming there is a place for me to identify the objectid?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my page for reference. Thanks everyone&lt;/P&gt;&lt;P&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta charset="utf-8" /&amp;gt;&lt;BR /&gt;&amp;lt;meta&lt;BR /&gt;name="viewport"&lt;BR /&gt;content="initial-scale=1, maximum-scale=1,user-scalable=no"&lt;BR /&gt;/&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;&lt;BR /&gt;FeatureTable widget with editing enabled | Sample | ArcGIS API for&lt;BR /&gt;JavaScript 4.22&lt;BR /&gt;&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;link&lt;BR /&gt;rel="stylesheet"&lt;BR /&gt;href="&lt;A href="https://js.arcgis.com/4.22/esri/themes/light/main.css" target="_blank"&gt;https://js.arcgis.com/4.22/esri/themes/light/main.css&lt;/A&gt;"&lt;BR /&gt;/&amp;gt;&lt;BR /&gt;&amp;lt;script src="&lt;A href="https://js.arcgis.com/4.22/" target="_blank"&gt;https://js.arcgis.com/4.22/&lt;/A&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;html,&lt;BR /&gt;body {&lt;BR /&gt;height: 100%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;margin: 0;&lt;BR /&gt;padding: 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;#viewDiv {&lt;BR /&gt;height: 50%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.container {&lt;BR /&gt;height: 50%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;require([&lt;BR /&gt;"esri/Map",&lt;BR /&gt;"esri/views/MapView",&lt;BR /&gt;"esri/layers/FeatureLayer",&lt;BR /&gt;"esri/widgets/FeatureTable",&lt;BR /&gt;"esri/widgets/Editor"&lt;BR /&gt;], (Map, MapView, FeatureLayer, FeatureTable,Editor) =&amp;gt; {&lt;BR /&gt;let featureLayer;&lt;BR /&gt;const features = [];&lt;/P&gt;&lt;P&gt;const map = new Map({&lt;BR /&gt;basemap: "streets-navigation-vector"&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;const view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: map,&lt;BR /&gt;center: [-95.75,29.18],&lt;BR /&gt;zoom: 7,&lt;BR /&gt;popup: {&lt;BR /&gt;autoOpenEnabled: false&lt;BR /&gt;} //disable popups&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;view.when(() =&amp;gt; {&lt;BR /&gt;featureLayer = new FeatureLayer({&lt;BR /&gt;// URL to the service&lt;BR /&gt;url: "&lt;A href="https://xxxxxxxxxxxxxxxxx/FeatureServer/0" target="_blank"&gt;https://xxxxxxxxxxxxxxxxx/FeatureServer/0&lt;/A&gt;",&lt;BR /&gt;outFields: ["*"],&lt;BR /&gt;title: "Emergency Reporting Areas"&lt;BR /&gt;});&lt;BR /&gt;map.add(featureLayer);&lt;/P&gt;&lt;P&gt;// Create the feature table&lt;BR /&gt;const featureTable = new FeatureTable({&lt;BR /&gt;view: view,&lt;BR /&gt;layer: featureLayer,&lt;BR /&gt;editingEnabled: true,&lt;BR /&gt;menuConfig: {&lt;BR /&gt;items: [&lt;BR /&gt;{&lt;BR /&gt;label: "Zoom to feature(s)",&lt;BR /&gt;iconClass: "esri-icon-zoom-in-magnifying-glass",&lt;BR /&gt;clickFunction: (event) =&amp;gt; {&lt;BR /&gt;zoomToSelectedFeature();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;},&lt;BR /&gt;// Autocast the FieldColumnConfigs&lt;BR /&gt;fieldConfigs: [&lt;BR /&gt;{&lt;BR /&gt;name: "name",&lt;BR /&gt;label: "Area Name",&lt;BR /&gt;editable: false,&lt;BR /&gt;direction: "asc"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "type",&lt;BR /&gt;label: "Type",&lt;BR /&gt;editable: false,&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "boilwater",&lt;BR /&gt;label: "Boil Water Notice?"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "evacuation",&lt;BR /&gt;label: "Evacuation Status"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "poweroutage",&lt;BR /&gt;label: "Power Outage?"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;name: "highwater",&lt;BR /&gt;label: "High Water?"&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;container: document.getElementById("tableDiv")&lt;BR /&gt;});&lt;BR /&gt;const polyInfos = {&lt;BR /&gt;layer: featureLayer,&lt;BR /&gt;label:"name",&lt;BR /&gt;updateEnabled: false,&lt;BR /&gt;formTemplate: {&lt;BR /&gt;// autocasts to FormTemplate&lt;BR /&gt;elements: [&lt;BR /&gt;{&lt;BR /&gt;// autocasts to FieldElement&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "name",&lt;BR /&gt;label: "Area"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "type",&lt;BR /&gt;label: "Type"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "poweroutage",&lt;BR /&gt;label: "Power Outage"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "boilwater",&lt;BR /&gt;label: "Boil Water?"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;type: "field",&lt;BR /&gt;fieldName: "evacuation",&lt;BR /&gt;label: "Evacuation Status"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;const editor = new Editor({&lt;BR /&gt;view: view,&lt;BR /&gt;&lt;BR /&gt;layerInfos: [polyInfos],&lt;BR /&gt;// It is possible to set snapping via the API by directly setting SnappingOptions in the Editor. This can also be toggled on/off using the CTRL key. By default snapping is not enabled, setting enabled to true toggles this.&lt;BR /&gt;snappingOptions: {&lt;BR /&gt;// Autocastable to snapping options&lt;BR /&gt;enabled: true, // sets the global snapping option that controls both geometry constraints (self-snapping) and feature snapping.&lt;BR /&gt;featureSources: [&lt;BR /&gt;{&lt;BR /&gt;// Autocastable to FeatureSnappingLayerSource&lt;BR /&gt;// Enable feature snapping on specified layer(s)&lt;BR /&gt;layer: featureLayer&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;// Get the FeatureLayer's layerView and listen for the table's selection-change event&lt;BR /&gt;featureTable.on("selection-change", (changes) =&amp;gt; {&lt;BR /&gt;// If the selection is removed, remove the feature from the array&lt;BR /&gt;changes.removed.forEach((item) =&amp;gt; {&lt;BR /&gt;const data = features.find((data) =&amp;gt; {&lt;BR /&gt;return data.feature === item.feature;&lt;BR /&gt;});&lt;BR /&gt;if (data) {&lt;BR /&gt;features.splice(features.indexOf(data), 1);&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// If the selection is added, push all added selections to array&lt;BR /&gt;changes.added.forEach((item) =&amp;gt; {&lt;BR /&gt;const feature = item.feature;&lt;BR /&gt;features.push({&lt;BR /&gt;feature: feature&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;view.ui.add(editor, "top-right");&lt;BR /&gt;function zoomToSelectedFeature() {&lt;BR /&gt;// Create a query off of the feature layer&lt;BR /&gt;const query = featureLayer.createQuery();&lt;BR /&gt;// Iterate through the features and grab the feature's objectID&lt;BR /&gt;const featureIds = features.map((result) =&amp;gt; {&lt;BR /&gt;return result.feature.getAttribute(featureLayer.objectIdField);&lt;BR /&gt;});&lt;BR /&gt;// Set the query's objectId&lt;BR /&gt;query.objectIds = featureIds;&lt;BR /&gt;// Make sure to return the geometry to zoom to&lt;BR /&gt;query.returnGeometry = true;&lt;BR /&gt;// Call queryFeatures on the feature layer and zoom to the resulting features&lt;BR /&gt;featureLayer.queryFeatures(query).then((results) =&amp;gt; {&lt;BR /&gt;view.goTo(results.features).catch((error) =&amp;gt; {&lt;BR /&gt;if (error.name !== "AbortError") {&lt;BR /&gt;console.error(error);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body&amp;gt;&lt;BR /&gt;&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div class="container"&amp;gt;&lt;BR /&gt;&amp;lt;div id="tableDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 20:38:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-table-editing-wrong-feature-when-sorted/m-p/1140541#M76255</guid>
      <dc:creator>JasonJordan00</dc:creator>
      <dc:date>2022-02-03T20:38:25Z</dc:date>
    </item>
  </channel>
</rss>

