Modern SharePoint Online sites has lot of great features for creating news articles. One thing is still missing and that is scheduled publishing approval for news.
You can do that by using SharePoint List content approval feature and creating approval workflow using Power Automate (previously called Microsoft Flow).
We need to do the following steps:
- Activate content approval in SharePoint Site Pages Library
- Create a new Publishing Date column in Site Pages Library
- Create an approval workflow for Site Pages using Power Automate
Activate content approval in SharePoint Site Pages Library
Go to your site pages library and change approval settings. You can do that via Library Setting. Go to Site Pages > Library Settings > Versioning settings > Require content approval for submitted items and choose yes. See picture below.
Create a new Publishing Date column in Site Pages Library
We need a new column for scheduled publishing. I have created column named PublisingDate, Type: Date And Time, Format: Date & Time. You can do a new column in Pages Library settings. Go to Site Pages > Library settings > Create column. See picture below.
Create an approval workflow for Site Pages using Power Automate
Then we need to create our publishing approval workflow. If you are not familiar to Power Automate, you can look the instructions and examples from Microsoft’s Power Automate documentation.
I have created following workflow actions and conditions:
- When an item is created or modified
- Get file properties
- Get file metadata
- Condition – if not draft version
- If Yes > terminate the flow
- If no > Condition for checking the Publishing Date
- If Publising date is null > Set content approval status > Approved immediately
- If not null > Delay until Publising date has passed
- Set content approval status > Approved
You can see the overview for the workflow by clicking the picture below.
Workflow actions and conditions
Create a new automated workflow in Power Apps and select trigger “When an item is created or modified”.
Modify “When an item is created or modified” action and select the Site Address and the list name.
Insert and then modify the Get file properties action. Select the Site Address, Library name and ID. See picture below.
Insert the Get file metadata action and modify it to get File identifier.
Then we need to create an If-condition for checking the content approval status for the page. We add condition if the content approval status is equal to to draft. If the page is draft version we simply terminate the workflow and set the workflow status to cancelled.
If the page content approval status is not the draft, then we do the approval for the page.
In the approval process we create an another condition to check the publishing date and time.
If the PublishedDate in the SharePoint Page is null, we approve the page immediately by setting the content approval status to “Approved”
If the PublishedDate in the SharePoint Page is not null, then we approve the page after the publishedDate has passed by setting the content approval status to “Approved”.
Here we need to create “Delay Until” -action and then set the content approval status to “Approved”. See picture below.
Test the scheduled publishing and approval flow
After you have created the approval workflow by using the Power Automate, you can test the news publishing by creating a new news article in SharePoint.
Create a new news in SharePoint Site Pages and modify PublishingDate value in the Page Details settings.
When the page is saved as draft, the approval status is changed as “draft” in site pages library.
When your page is ready for approval, submit it by clicking the “Submit for approval” -button.
After that you can see the “Pending” status in the site pages library.
After the Published Date has passed, the page is approved by your workflow and the approval status has been changed to “Approved” in the site pages library.
That’s it! You can schedule your SharePoint News and create auto-approval using the Power Automate workflow.
You can check the workflow status in the Power Automate settings.
Workflow has been cancelled in the draft versions of the pages. And in the submitted pages, the workflow has been succeeded correctly. See pictures below.