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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Checking if a file is ...
Power Automate
Unanswered

Checking if a file is updated in a SharePoint library

(0) ShareShare
ReportReport
Posted on by

Hi all, I am working on an Automated Flow using the SharePoint "When an item or a file is modified" trigger to process a PDF file in a SharePoint library for multiple stages of approvals. At each approval stage, a single approver needs to review the PDF file, stored in the SharePoint library, and either reject the approval in the Power Automate Approval Center, or digitally sign the PDF and re-upload the file and then approve the action in the Power Automate Approval Center. I am using the "Get Changes for an item or a file (properties only)" action to check if the "Workflow Status" field I created was updated to trigger each approval stage. I am also using a Do Until loop using a boolean variable to re-generate the approval at each stage in the event a reviewer approves the action in the Approval Center without having updated the PDF file in the SharePoint library, making sure to escape out of the Do Until loop in the event the reviewer rejects the action. I know there is no way to actually check if the reviewer digitally signed the document, so I am hoping that simply checking if the file was modified and checked in will be sufficient.

 

I have the flow working to trigger each approval stage by using the "Has Column Changed: Workflow Status" property, but I am unsure on how to go about checking whether the file was updated or not. My initial thought is to use another "Get Changes for an item or a file (properties only)" action after the "Wait for Approval" action and subsequent "Approve" Condition using the window between timestamps of the Request Date and Completion Date (i.e., when was the approval created and when did the reviewer approve the action) to determine if the file version changed, as an indirect proxy of the reviewer updating the file with their digital signature. Can I use the "Is Current Version" property from "Get Changes for an item or a file (properties only)" to determine if the file version changed during the approval window, do a comparison to check that the "Until Version Number" from the post-approval "Get Changes for an item or file" is greater than the "Until Version Number" from the pre-approval "Get Changes for an item or file", or do I need to use a "Send an HTTP request to SharePoint" action to the SharePoint API to get this information? If I need to use the SharePoint API, how might I go about this? Otherwise, how do I go about checking the reviewer has updated the file in the library?

 

Thanks!

Categories:
I have the same question (0)
  • v-litu-msft Profile Picture
    on at

    Hi @rebornScholar86,

     

    You could check if the Modified time greater than the approval request sent time, to determine the file whether to be modified or not. Steps as below:Screenshot 2020-12-25 110221.jpg

     

    Screenshot 2020-12-25 110307.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • rebornScholar86 Profile Picture
    on at

    Hi @v-litu-msft ,

     

    Unfortunately this does not work for me, as when I update the PDF file in the SharePoint document library with versioning turned on, it creates a new file and forces me to manually re-enter all the metadata, resulting in a new item with a new ID being created. It doesn't modify the original library item containing the original file. This is already a problem, as I need SharePoint to replace the original PDF file with the updated PDF file, retain the metadata without it needing to be copied over, retain the original document library ID, and increase the major version number.

     

    Here is how I attempted to implement your solution above, but due to the above mentioned issue, it does not complete the loop by setting boolFileUpload to true after the Yes conditional branch of "Check if file was updated by Immediate Supervisor"

     

    firstApprovalBranchWithFileModifiedChange.PNG

     

    Here is an expanded view where I am using the Request date and Completion Date timestamps for my window

    firstApprovalBranchWithFileModifiedChangeTriggers.PNG

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard