I need to start a flow when a document in a SharePoint online document library has been checked in. The responsible is added to the metadata of the library.
The flow checks if the responsible is equal to the editor of that document:
- If it evaluate to
true
, the status of the document must change topublish
, - Else the status of the document must change to
draft
and an approval must be send to the responsible:- If the approval is accepted, the status must change to
publish
, - Else the status must stay on
draft
and the editor must receive an email that it has been denied.
- If the approval is accepted, the status must change to
The problem is that I can't change the metadata of a document when it's not checked in. I've got this error:
The file is not checked out. You must first check out this document before making changes.
The reason why I don't want to trigger when a document is created or edited is because if the editors saved temporary, the flow run with an unfinished document. When it's checked in, the document is finished and then it has sense that the approval needs to start (when the condition for that evaluates successfully).
P.S.: This question continuous on this question: Trigger Flow when document in SharePoint has been checked-in.