SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.23k stars 992 forks source link

Changes made by `setValue` don't sync in other users view #9758

Open marcokitzmann opened 2 weeks ago

marcokitzmann commented 2 weeks ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

Declarative list formatting

Developer environment

None

What browser(s) / client(s) have you tested

Additional environment details

Describe the bug / error

We use a button with setValue to add a person and set a new status to an item with a single click in list view. However, during testing we realised that changes made by setValueaction do not sync in other editors views. This leads to problems because the button may be clicked again by other editors and tasks may be worked on by several people.

setValueBug.webm

Steps to reproduce

  1. Add a JSON format to a person field that gives it a button with a customRowAction of type setValue. i.e.

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "children": [ { "elmType": "div", "style": { "display": "=if(([$Status] == 'To Do' || [$Status] == '' || [$Status] == 'Watch' || [$Status] == 'Idee') && [$Autor] == '', 'flex','none')", "flex-direction": "row" }, "children": [ { "elmType": "div", "style": { "width": "95px", "height": "26px", "border-radius": "3px", "cursor": "pointer", "display": "flex", "align-items": "center", "justify-content": "space-evenly", "margin": "5px" }, "attributes": { "class": "ms-bgColor-themePrimary ms-bgColor-themeDark--hover ms-fontColor-white ms-fontSize-12 ms-fontWeight-bold" }, "customRowAction": { "action": "setValue", "actionInput": { "Status": "In Arbeit", "Autor": "@me" } }, "children": [ { "elmType": "div", "txtContent": "Ãœbernehmen" } ] } ] }, { "elmType": "div", "children": [ { "elmType": "span", "txtContent": "=join(@currentField.title, ', ')", "style": { "padding-left": "5px", "word-break": "keep-all" } } ] } ] }

  1. Use the button and observe in a second browser whether the changes are visible.

Expected behavior

A click on the button in list view should trigger the change of the values and these changes should be immediately visible to other users.

tpodugu-ms commented 1 week ago

@marcokitzmann Thanks for reporting the bug. We will take a look at this and update on the timelines.