Update Popups on FeatureLayer Refresh?

1517
5
Jump to solution
04-15-2021 10:05 AM
LoganMichaels1
New Contributor II

Hello! My webapp is performing bulk attribute edits using the applyEdits() function of the JS API, however after the updates are performed, our popups are not reflecting those updates. It seems that the solution would be to refresh the feature layer (using featurelayer.refresh()), however it seems that the popups do not reflect the refreshed state. Can anyone speak to this?

0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi Logan, 

You should not have to call `FeatureLayer.refresh()` as applyEdits takes care of it. Are you sure that your applyEdits operation is running successfully? I have updated the bulk edits test app that I created for you from dev summit. I configured the popupTemplate of the layer and you can see that the attributes are updated after applyEdits is called. 

-Undral

View solution in original post

0 Kudos
5 Replies
UndralBatsukh
Esri Regular Contributor

Hi Logan, 

You should not have to call `FeatureLayer.refresh()` as applyEdits takes care of it. Are you sure that your applyEdits operation is running successfully? I have updated the bulk edits test app that I created for you from dev summit. I configured the popupTemplate of the layer and you can see that the attributes are updated after applyEdits is called. 

-Undral

0 Kudos
LoganMichaels1
New Contributor II

Undral, thanks so much for getting back with me! I traced the problem to my forming the popupTemplate incorrectly. I was putting single quotes around the field names inside the braces, which is incorrect.

On an unrelated note, we are passing a large quantity of edits through applyEdits, anywhere from 4,000 to 10,000 at a time. We've hit a lot of issues in this regard, and wanted to know what the most performant method would be to accomplish this. We've considered batching our edits into groups of 2,000, but thought there might be another option.

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

I talked to one our devs for feature services. He suggested that you keep the count no more than 1000 at a time to ensure successful applyEdits operation.

0 Kudos
LoganMichaels1
New Contributor II

That's perfect, thank you! How can we ensure that no geometry updates are being sent in the applyEdits request? We are only editing attributes, however when I send the updates, I receive an error that the feature layer doesn't support geometry updates. This is desired, because we only want to update attributes, however for some reason it believes there are geometry updates being sent.

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

The test app I provided already does that. When you query your features to edit, you set the query parameter's returnGeometry to false as shown below:

 const query = {
  geometry: geometry,
  outFields: ["*"],
  returnGeometry: false
 };

 

Check out the test app. I added the console.log to show that feature's geometry is null. If you have other questions please create a new question since the original question is addressed.

 

Thanks,

-uNDral