SharePoint / sp-dev-docs

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

ColoumFormatting: Action Input can't update ModerationStatus anymore #9897

Closed joshua-probst closed 2 months ago

joshua-probst commented 2 months ago

Target SharePoint environment

SharePoint Online

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

Declarative list formatting

Developer environment

Windows

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

Additional environment details

No response

Describe the bug / error

I dont know if this is the right place, but i found a bug when using coloumn formatting for editing the default approval value.

Sample (which sample are you having trouble with)

https://github.com/pnp/List-Formatting/tree/master/column-samples/approval-buttons-setValue-status-user

I edit the action input to : "actionInput": { "_ModerationStatus": "0", "ApprovalActionBy": "@me" }

What Should Happen

For a few days now I and other users have had the problem that the buttons for approving and rejecting no longer work. The manual approval still works and if i changed the action input to edit a single text coloum everything works fine. So in my opinion there must be a change or something that i cant edit the moderation status anymore. Do you have any clue why this doesnt work?

What Actually Happens

At the moment you press the button and nothing happen. Is there a way to debug the thinks in the background because the browser console is empty.

Steps to reproduce

  1. Activate Approval in List
  2. Create Single List Coloumn
  3. Format the coloumn with following code :

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "style": { "flex-directon": "row", "justify-content": "left", "align-items": "center", "flex-wrap": "nowrap" }, "children": [ { "elmType": "div", "style": { "display": "inherit", "flex-directon": "row", "justify-content": "left", "align-items": "center", "flex-wrap": "wrap" }, "children": [ { "elmType": "button", "customRowAction": { "action": "setValue", "actionInput": { "_ModerationStatus": "0", "ApprovalActionBy": "@me" } }, "attributes": { "class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover" }, "style": { "border": "none", "background-color": "transparent", "cursor": "pointer", "display": "flex", "flex-directon": "row", "justify-content": "left", "align-items": "center", "flex-wrap": "wrap" }, "children": [ { "elmType": "span", "attributes": { "iconName": "SkypeCircleCheck" }, "style": { "padding": "4px" } }, { "elmType": "span", "txtContent": "Approve", "style": { "word-break": "keep-all" } } ] } ] } ] }

Expected behavior

Approve List Item -> worked for me for 2 years.

tpodugu-ms commented 2 months ago

@joshua-probst Thanks for reporting. We will work on this and share an update soon.

deepamajhi commented 2 months ago

Hi @joshua-probst was this _moderationStatus working before when you do setValue?

joshua-probst commented 2 months ago

@deepamajhi in combination with approvalactionby it workes for me for maybe two years.

deepamajhi commented 2 months ago

Hi @joshua-probst modifying ApprovalStatus is not supported through setValue. You can check this document and see the supported column types for setValue https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-advanced

deepamajhi commented 2 months ago

Hii @joshua-probst .. do you have any further queries on this or we can close this item?

joshua-probst commented 2 months ago

@deepamajhi you can close this item.