Forum Discussion

AlexFl4's avatar
AlexFl4
Copper Contributor
Jul 03, 2025

Sharepoint CommandbarProps - looking for "Approve/Reject"

Hi community

 

looking how I can promote/make the "Approve/Reject" button to be the left most button replacing the "+New" button.

The "Approve/Reject" button comes with the  built-in Sharepoint approval flow the main button, which I turned on for my document libbrary.


I looked through the MS reference page https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting

but cant find it.

 

any suggestions how to achieve that ?

thanks alex.

5 Replies

  • michalkornet's avatar
    michalkornet
    Iron Contributor

    AlexFl4​  that's great, maybe you can also make a change request in github to include this key in the documentation :)

  • michalkornet's avatar
    michalkornet
    Iron Contributor

    Hi AlexFl4​, have you tried using the PublishCommand key? From what I understood in the topic i shared before, some people managed to get the "Submit for Approval" button working, so maybe the approve/reject button can also be handled by the same key. I haven't tested it myself, unfortunately.

    • AlexFl4's avatar
      AlexFl4
      Copper Contributor

      Hi michalkornet​ . The following JSON code actually did the job for me.


      Now the "Approve/Reject" button is prominently displayed top left in the main menu bar.

      thanks alex

  • michalkornet's avatar
    michalkornet
    Iron Contributor

    Hi AlexFl4​ as I understand from this topic, someone was able to modify the command using the PublishCommand key.

     

    https://github.com/SharePoint/sp-dev-docs/issues/8575#issuecomment-2647162212

    • AlexFl4's avatar
      AlexFl4
      Copper Contributor

      Hello Michal

      it seems there is a key for "Approve/Reject", which is not (yet) documented for use in JSON formatting: 
      "approveReject"

      I want to move that command to the left most position on the menu bar, since it is still "hidden" in a submenu:

      I want to move that command left to the "New" button. the following JSON does NOT do the job unfortunately:

      best regards alex.

Resources