web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Check out the file bac...
Power Automate
Suggested Answer

Check out the file back to the Initiator if Rejected

(1) ShareShare
ReportReport
Posted on by 8
Hi,
 
I made an automatic document Approval Flow where, when Initiator check in a file, the Document Status and Approval Status Column will be updated and an email will be sent to the Approvers for approval. If all Approvers approved it will be checked in as a major version, update the status columns and send a notification email that it has been approved. If one of the Approvers rejected it, it will still update the status column, send a notification to the initiator and terminate the flow.
 
My questions are:
1. can I include a condition in the trigger that the document should be checked in as a minor version?
2. Since I require document check out, the only way I can update the status columns is to include check out in my flow, is there other ways to do it?
3. Since I was the one who made the flow, the document was checked out to me, I have no concern if the document was approved because it will be checked in as Major version, the problem will be if the document is rejected it will stay checked out to me. Is there a way to return back the document check out to the initiator if it is rejected?
 
Thanks in advance.
 
Just an UPDATE on this one:
 
I achieved this by using an Instant Cloud flow which can be triggered and be run by other user.
 
Categories:
  • Suggested answer
    Ninjasabi Profile Picture
    122 on at
    1. To include a condition in the trigger that the document should be checked in as a minor version, you can use the "When a file is created or modified (properties only)" trigger in Power Automate. You can then add a condition to check if the document is checked in as a minor version.
     
    - trigger: When a file is created or modified (properties only)
      inputs:
        siteAddress: "YourSharePointSite"
        libraryName: "YourDocumentLibrary"
    - action: Condition
      inputs:
        condition: "@contains(triggerOutputs()?['body/OData__UIVersionString'], '.0')"
      ifTrue:
        actions:
          # Continue with the flow
      ifFalse:
        actions:
          # Terminate the flow or take other actions
     
    2. Since you require document check-out, you can include the check-out and check-in actions within your flow to update the status columns. Unfortunately, there is no way to update the columns without checking out the document if check-out is required.
     
    - action: Check out file
      inputs:
        siteAddress: "YourSharePointSite"
        libraryName: "YourDocumentLibrary"
        id: "@triggerOutputs()?['body/ID']"
    - action: Update file properties
      inputs:
        siteAddress: "YourSharePointSite"
        libraryName: "YourDocumentLibrary"
        id: "@triggerOutputs()?['body/ID']"
        properties:
          DocumentStatus: "InProgress"
          ApprovalStatus: "Pending"
    - action: Check in file
      inputs:
        siteAddress: "YourSharePointSite"
        libraryName: "YourDocumentLibrary"
        id: "@triggerOutputs()?['body/ID']"
        checkInType: "MinorCheckIn"
        comment: "Updated status columns"
     
    3. To return the document check-out to the initiator if it is rejected, you can use the "Check out file" action to check out the document to the initiator. You will need to know the initiator's email or user ID.
     
    - action: Condition
      inputs:
        condition: "@equals(outputs('Start_and_wait_for_an_approval')?['body/outcome'], 'Reject')"
      ifTrue:
        actions:
          - action: Check out file
            inputs:
              siteAddress: "YourSharePointSite"
              libraryName: "YourDocumentLibrary"
              id: "@triggerOutputs()?['body/ID']"
              user: "@triggerOutputs()?['body/Author/Email']"
          - action: Send an email (V2)
            inputs:
              to: "@triggerOutputs()?['body/Author/Email']"
              subject: "Document Rejected"
              body: "Your document has been rejected."
          - action: Terminate
            inputs:
              status: "Failed"
              message: "Document rejected by approver."
      ifFalse:
        actions:
          # Continue with the flow
     
  • AT-23070245-0 Profile Picture
    8 on at
    @Ninjasabi thanks for the quick response.
     
    I tried your suggestion; however I got an error saying Condition-trigger failed. I don't know if I did it correctly though. This is what I did based on the instruction
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 445

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 300

Last 30 days Overall leaderboard