<?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: Refresh a single feature on FeatureLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-a-single-feature-on-featurelayer/m-p/1293525#M81266</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you figured out already, the refresh does not support the workflow you are asking for. It is something we plan on supporting in the future.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is your app using MapView? Then as you suggested you can use applyEdits for more focused refreshes. Can you please see if the workaround works? If the layer emits an edit event with the updated, added, or removed features, that triggers the refresh of that feature.&amp;nbsp;&lt;A href="https://codepen.io/ycabon/pen/BaqENbb?editors=0010" target="_blank" rel="noopener"&gt;https://codepen.io/ycabon/pen/BaqENbb?editors=0010&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2023 16:39:33 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2023-05-26T16:39:33Z</dc:date>
    <item>
      <title>Refresh a single feature on FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-a-single-feature-on-featurelayer/m-p/1293411#M81264</link>
      <description>&lt;P&gt;On my app I have a MapView with a FeatureLayer, sometimes a feature is added to that FeatureLayer in the backend as part of a separate user flow and my javascript application receives its id.&lt;/P&gt;&lt;P&gt;The new feature is displayed after I call &lt;EM&gt;.refresh()&lt;/EM&gt;&amp;nbsp;on my FeatureLayer but that forces a full reload of the data which seems like a waste.&lt;/P&gt;&lt;P&gt;So my question is: &lt;STRONG&gt;provided I have an objectId of a feature that was added in the background, how can I make my FeatureLayer/MapView display it in the most optimal way?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When I add a feature using the &lt;EM&gt;applyEdits&lt;/EM&gt;&amp;nbsp;function from the FeatureLayer I notice that a more focused refresh is done (not as many calls as a refresh), so there seems to be a way and I can't find any documentation about it.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 12:14:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-a-single-feature-on-featurelayer/m-p/1293411#M81264</guid>
      <dc:creator>LucasBertoni</dc:creator>
      <dc:date>2023-05-26T12:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh a single feature on FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-a-single-feature-on-featurelayer/m-p/1293525#M81266</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you figured out already, the refresh does not support the workflow you are asking for. It is something we plan on supporting in the future.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is your app using MapView? Then as you suggested you can use applyEdits for more focused refreshes. Can you please see if the workaround works? If the layer emits an edit event with the updated, added, or removed features, that triggers the refresh of that feature.&amp;nbsp;&lt;A href="https://codepen.io/ycabon/pen/BaqENbb?editors=0010" target="_blank" rel="noopener"&gt;https://codepen.io/ycabon/pen/BaqENbb?editors=0010&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2023 16:39:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-a-single-feature-on-featurelayer/m-p/1293525#M81266</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-05-26T16:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh a single feature on FeatureLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-a-single-feature-on-featurelayer/m-p/1294027#M81274</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;thanks for your reply, the workaround worked perfectly, it causes the same effect as if I had used the clientside `applyEdits` function.&lt;/P&gt;&lt;P&gt;I had tried emitting that event before posting here, but my mistake was not adding all the empty arrays to the event object, as soon as I added them it started working as expected.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 13:21:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/refresh-a-single-feature-on-featurelayer/m-p/1294027#M81274</guid>
      <dc:creator>LucasBertoni</dc:creator>
      <dc:date>2023-05-30T13:21:36Z</dc:date>
    </item>
  </channel>
</rss>

