Forum Discussion
Approval Flow - Approval Status - why can't this be updated?
Hi there Tanya Denton...can you provide in some detail how you got this to work? I've been pulling my hair out trying to get the Approval Status flag to change depending on the response sent out from the Flow approval e-mail, and I can't seem to get it to work. I am using the 'Set content approval status' that Michal Golan mentioned, but it doesn't seem to work.
What am I doing wrong?!?! :)
- Tanya DentonNov 28, 2018Steel ContributorHere is a document with the broken down steps. Although the steps say item it is based on a Document library. the only part that i believe is not possible is to start the flow when you use the 'Publish' document feature, but from Draft the user can go Flow and select the flow to start the approval.
- David DreverDec 05, 2018MVP
I just thought I would mention it is possible to run this automatically (via item created or modified). The problem getting in people's way is that when they start a flow, there is no OOTB method for determining the state the document is in. You don't want an approval workflow if the document is still in draft right?
I came up with a way to do this using an HTTP call into the SharePoint list\library. This likely isn't anything new, but I wasn't able to find a post that highlighted the steps I came up with. To determine the approval status of a document\list item you simply have to access it using the following REST call: _api/web/lists/GetByTitle(‘<Title>’)/items(<ID>)?$select=OData__ModerationStatus
More information and some step-by-step procedures can be found here: http://prairiedeveloper.com/2018/12/microsoft-flow-determine-the-approval-status-of-a-sharepoint-list-or-library-item/
- Soraia TaipaDec 27, 2018Copper Contributor
Hi Tanya Denton,
Thank you for your reply. I've tested and it keeps no updating... I've added a second step to update the properties of the document, only with that step does the status changes...
- Soraia TaipaDec 27, 2018Copper ContributorHi Tanya Denton,
Thank you for your reply. I've tested and it keeps no updating... I've added a second step to update the properties of the document, only with that step does the status changes...
- racrigMar 05, 2020Brass Contributor
Hello everyon ~ jdiorio
I'm still struggling to get Flow to work with the OOTB SharePoint content approval functionality. I have a Flow now the does include the (not-at-all-obvious) Get File Metadata action so that I can get the right Etag and reference it in the Set Content Approval action. However, the action just does not work. Here is the explanation I posted on the Flow community board:
I have a Flow running on a SPO list with content approval enabled. There is no approval task -- only the action to Set Content Approval. My flow has to update some metadata, which of course sets the Approval Status to Draft. I thought I could use the Set Content Approval action in Flow to force the status back to Approved. (I do have the Get File Metadata action in place immediately beforehand and the Etag is set.) But I get this error:
{"error": {"code": 502,"source": "flow-apim-msmanaged-na-westus2-01.azure-apim.net","clientRequestId": "ae99f1e8-a0e1-4b37-8f4a-6207da707c04","message": "BadGateway","innerError": {"status": 500,"message": "The current state of the item is Draft and the following action Approve cannot be implemented\"\r\nclientRequestId: ae99f1e8-a0e1-4b37-8f4a-6207da707c04\r\nserviceRequestId: ae99f1e8-a0e1-4b37-8f4a-6207da707c04"}}}So the flow updates my file properties, but then will not set the Approval Status because it's in Draft?? Even back in SP Designer, I could force the Approval Status back to where I needed it to be. Does anyone know how to make this work?(Please note, the Flow was running fine before the Set Content Approval action was added. No bad gateways prior to that change.)*************************************This is all super frustrating because we SharePoint people have spent YEARS trying to get business users to embrace the control and automation of Content Approval. Now O365 comes out and it's so great...BUT....it does not work with this key, basic, bedrock, foundational feature of SharePoint. How can we do content management in the main Microsoft content management platform if these things are unworkable?If anyone has a clue, please reply. Thank you all.