Default SharePoint list view does not update when adding items using Rest API #10087
Open
2 of 9 tasks
Labels
type:bug-suspected
Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
None
What browser(s) / client(s) have you tested
Additional environment details
Describe the bug / error
When creating a new item in a list using the default newform in a list using the latest modern UI the list automatically shows this new item. Even if I add the item in Chrome and have the same list view open in Edge, the item is immediately shown in the list view in both browsers.
If I however add a new item using REST, the list view sometimes shows the item after approximately 30 seconds for the first item - adding additional items using REST does not show the items in the view at all until I manually refresh the page or navigate to another list using the left menu and then back again.
I'm wondering how to ensure that changes made to the list is shown in the list view without having to manually reload the page.
Steps to reproduce
These steps use an example code snippet to create a new list item in a list.
The output will show the list item you crated like this:
In my command set extension I'm creating items using a custom form using something like this:
sp.web.lists.getById([GUID]).addValidateUpdateItemUsingPath(formValues);
I would appreciate some guidance on how to make the list view update to show the new items.
Expected behavior
The list view should update to show the new items within a few seconds.
Alexander
The text was updated successfully, but these errors were encountered: