Hey there
I am trying to check out a file in the context of an approval flow (so the document is checked out until it has been either approved / rejected).
I have tried both with the regular "Check out file" action, as well as the SharePoint HTTP action.
In my trouble shooting i tried to create a manual flow that executed the HTTP action statically towards the document. This worked fine and resulted in the document getting checked out in the SharePoint UI as well:
Here is the input for the test (manual) flow:
{
"host": {
"connectionReferenceName": "shared_sharepointonline",
"operationId": "HttpRequest"
},
"parameters": {
"dataset": "https://xxx.sharepoint.com/sites/WP365_8/Instruks3",
"parameters/method": "PATCH",
"parameters/uri": "_api/web/getFileByServerRelativeUrl('/sites/WP365_8/Instruks3/Documents/Document.docx')/CheckOut",
"parameters/headers": {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
}
}
}
The action in my workflow is identical to this one, and executes fine in the run, but the document is never checked in the SharePoint UI (and i am able to edit etc. with other accounts as well, so its not truly checked out):
Here is the input for the actual workflow:
{
"host": {
"connectionReferenceName": "shared_sharepointonline",
"operationId": "HttpRequest"
},
"parameters": {
"dataset": "https://xxxx.sharepoint.com/sites/WP365_8/Instruks3",
"parameters/method": "PATCH",
"parameters/uri": "_api/web/getFileByServerRelativeUrl('/sites/WP365_8/Instruks3/Documents/Document.docx')/CheckOut",
"parameters/headers": {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
}
}
}
As you can see theyre identical. My current theory is that it has to do with the flow being triggered by a powerapp (and that this somehow messes up the "context" in which SharePoint has to check out the document).
Has anyone experienced this problem before?
Any help appreciated!