SharePoint Document Issues

How to Add a Publish or Unpublish Button to a SharePoint Library

Natalie TaylorNatalie Taylor Oct 21, 2026 873 views

Question details

The user wants to add a one-click publish or unpublish button in a SharePoint document library to quickly manage document statuses.

How to Add a Publish or Unpublish Button to a SharePoint Library
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Editing document metadata and attempting to manage document publication statuses directly from the library view.
Observed behavior
SharePoint document libraries do not provide a standard out-of-the-box button or default column-formatting option for publishing and unpublishing documents with a single click.
Before you start

Ensure you have Site Owner or Full Control permissions in your SharePoint environment and access to Microsoft Power Automate to create custom workflows.

Solution 1Recommended

Create a Custom Publish/Unpublish Button using Power Automate

Build a custom column formatted as a clickable button that triggers a Power Automate flow to change the document's publishing status.

Since SharePoint lacks a default button for this action, you must combine SharePoint's JSON column formatting with a custom Power Automate flow. This allows you to simulate a one-click publish experience.

1
Create a Power Automate flow

Go to Power Automate and create an instant cloud flow. Select 'For a selected file' as the SharePoint trigger. Add a subsequent action to 'Update file properties' or use a SharePoint HTTP request to change the publishing status of the selected document.

2
Add a new column in SharePoint

Navigate to your SharePoint document library. Click on 'Add column', choose 'Single line of text' or 'Choice', name the column 'Publish Document', and save it.

3
Apply JSON column formatting

Click the header of your new 'Publish Document' column, select 'Column settings', and then 'Format this column'. Choose 'Advanced mode' and paste a JSON script designed to render the column as a button that calls your specific Power Automate Flow ID.

4
Test the custom button

Select a document in the library and click the newly created button. Verify in Power Automate that the flow successfully runs and that the document's status updates to Published or Unpublished accordingly.

Create a Custom Publish/Unpublish Button using Power Automate
Need Help with Custom Code?: If you are unfamiliar with writing JSON for column formatting or building HTTP requests in Power Automate, you can request implementation guidance in Microsoft Q&A using the SharePoint tag.
Free Microsoft Office alternative

Try WPS Office for Streamlined Document Management

If complex SharePoint configurations and custom workflows are slowing down your productivity, consider switching to WPS Office. It provides a lightweight, unified suite for creating, editing, and managing documents without the hassle of setting up custom publishing scripts.

  1. 1. Download and install: Visit the official WPS Office website to download the free installation package for your PC or mobile device.
  2. 2. Open your documents directly: Launch WPS Office and open your existing Microsoft Office files. They will display seamlessly with perfect formatting compatibility.
  3. 3. Manage and collaborate: Use WPS Cloud to easily share file links and collaborate with team members without requiring complex publishing workflows.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formats.Lightweight design with an intuitive interface for faster document processing and sharing.Built-in cloud storage options that make organizing, saving, and collaborating on files simpler than complex library setups.Free access to powerful, essential office tools without expensive licensing or rigid versioning rules.
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't SharePoint have a default publish button in document libraries?

SharePoint is designed to rely heavily on versioning and strict content approval settings rather than a simple toggle button. Publishing is natively handled through the document's context menu or properties panel to ensure strict tracking and version control.

Can I use JSON column formatting without Power Automate to publish a document?

No. JSON column formatting alone only changes the visual appearance of the column (e.g., rendering text to look like a button). To actually execute an action like publishing or unpublishing, the button must trigger a Power Automate flow or invoke a custom SharePoint Framework (SPFx) extension.

Where can I get help with SharePoint custom development?

For advanced custom solutions, JSON formatting scripts, and Power Automate flow implementations, you can request expert guidance in the official Microsoft Q&A forums. Post your specific requirements and ensure you include the SharePoint tag.