Photo past times Zachary Nelson at Unsplash
Again I’m belatedly to the party, but Microsoft has released an activeness to Flow called “Set content approving status”. This activeness enables you lot to add together content approving non solely to listing elements in addition to documents inwards SharePoint, but too to word pages.
Microsoft has talked close content approving for ECM scenarios amongst communication pages for a while, but until a proper UI is inwards place, you lot tin larn started today!
This is how.
First off navigate to the Site Pages library where you lot practise your pages, in addition to become to the versioning settings for the library.
Ensure you lot get got turned on in addition to to the lowest degree content approving in addition to enabling major/minor versioning is too a adept stance then that editors tin salve their piece of occupation multiple times earlier hitting Publish for approval.
Next practise a Flow which trigger on the Site Pages library. I similar to outset from the Flow UI, but you lot tin outset off whatever agency you lot like.
Important! The user used for the connecter inwards the SharePoint actions, has to survive an possessor on the site, inwards guild to get got approving rights for items – or given the approving correct explicitly.
I volition outset amongst the SharePoint activeness “When an detail is created or modified”. The argue for triggering on modified every bit well, is to cater for the major/minor versioning scenario – inwards guild non to skip draft items.
If you’re advanced in addition to adventurous you lot tin cheque Serge Luca’s post which dives into how you lot tin modify the trigger to solely trigger on items based on properties of the item.
As the Site Pages library volition non listing automatically for this activeness (nor volition it for the file is created action), you lot get got to manually motion into the refer or the guid of your list.
Choose “Enter custom value” in addition to type the refer of your Site Pages library.
The side past times side pace is to cheque for the Pending approving status, which is what nosotros volition human activeness on. Any other approving state in addition to nosotros tin travel out the Flow.
Since I decided to complicate things amongst draft status, you lot currently get got to exercise the novel “Send an HTTP asking to SharePoint” activeness inwards guild to hollo back the approving condition of the item, which tin survive done amongst the next REST interrogation where the value is stored inwards the column _ModerationStatus, which is accessible via OData__ModerationStatus using REST.
_api/web/lists/getbytitle('Site%20Pages')/items(<id>)?$select=OData__ModerationStatus
In guild to larn inwards easier to cheque the value from the returned JSON I add together a Parse JSON pace amongst the next schema (generated from a examination query)
{ "type": "object", "properties": { "d": { "type": "object", "properties": { "__metadata": { "type": "object", "properties": { "id": { "type": "string" }, "uri": { "type": "string" }, "etag": { "type": "string" }, "type": { "type": "string" } } }, "OData__ModerationStatus": { "type": "number" } } } } }
The Pending approving state has a value of 2, then for whatever other value nosotros volition plow over notice the Flow. This is easily accomplished past times checking the value of the OData__ModerationStatus field.
To simplify my Flow I don’t add together farther commands inwards the Yes branch, but add together them below for amend readability.
The cheque is done, nosotros know the page is inwards pending state, requiring individual to approve or turn down it. And an tardily approach to exercise is the Flow approving action.
Once the email approving has taken house it’s fourth dimension to exercise the “Set content approving status” activeness depending on if the approver approved or rejected the item.
When approving a page you lot postulate a value for the ETag field. To larn a working ETag value exercise the “Get file metadata” activeness amongst the file identifier from the trigger action. One positive side of the approving activeness is that the Site Pages library automatically seem inwards the dropdown :-)
Looking dorsum at the site pages library, you lot run across the page is approved in addition to volition survive visible past times everyone.
Summary
Content approving is oft an of import characteristic of ECM, where non anyone tin issue articles or word at random. Tapping into the one-time approving functionality inwards SharePoint in addition to combining it amongst Microsoft Flow is a prissy agency to unblock this scenario. Once a user hits “Publish” on an article, nosotros boot off an approving workflow, where the approver tin approve the detail straight from the email message if they desire to.
If you lot postulate scheduling every bit well, but add together a column to the Site Pages library position a appointment inwards it, in addition to add together a Delay activeness inwards your Flow to interruption the actual setting of the Approval state.
The Flow today mightiness seem a fight convoluted, but I hold off a amend UI integration inwards the futurity based on previous communications from Microsoft om the ECM storey for Communication sites. The beauty is that this approving Flow is really generic in addition to tin survive used on whatever site in addition to for whatever library.
Thanks for reading : Use Microsoft Menses To Implement Approving Of Site Pages