SharePoint / SharePoint/sp-dev-docs

setValue throws error in document library

Open
#10,624 5 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since Feb 4, 2026.

area:list-formatting Needs: Author Feedback sharepoint-developer-support type:bug-suspected
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

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

Site designs & site scripts

Developer environment

None

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details
  • browser version
  • SPFx version
  • Node.js version
  • etc
Describe the bug / error

In a document library i have two fields.

  1. Approve - Single line of text
  2. ApprovalStatus - Choice
    I have added JSOn to Approv field. "Approve Button

{"$schema":"https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json","elmType":"button","txtContent":"Approve","customRowAction":{"action":"setValue","actionInput":{"ApprovalStatus":"Approved"}},"style":{"background-color":"#008000","color":"white","justify-content":"center","width":"75%","height":"80%","border-radius":"15px","box-shadow":"0 4px 8px 0 rgba(0,0,0,0.1), 0 4px 8px 0 rgba(0,0,0,0.1)"}}

"
This button click updates ApprovalStatus field sucessfully. But, getting error alert box.

Image
Steps to reproduce

1.in document library create fields 1. Approve - Single line of text, 2. ApprovalStatus - Choice
2.In Approve field add json format code
3.Add a file and click approve button in doc library

Expected behavior

It should show success alert like updated successfully.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.