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 / Scheduled Flow for Fil...
Power Automate
Unanswered

Scheduled Flow for File library to view properties and update based on certain columns

(0) ShareShare
ReportReport
Posted on by 10

I would like to run a flow after business hours to check all file and folders within a library, and if the data stored in a specific column changes to update another column based on the conditions.  I know I can do when file is modified, but it runs too frequently. 

  • Get File Properties only
  • Initialize Variable to pull the date displayed
  • Append string variable to provide date value
  • Compose date in certain format
  • condition to check for fields
  • update columns accordingly

ldelao15_0-1651086530719.png

 

Categories:
  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Can you please expand your Apply to Each actions so we can see the contents?

    I think to do this, you'd go through the following actions:

    0) Initialize an Array with the specific column names you want to check.

    1) Get Files (Properties Only) filtered on Modified ge '(Yesterday or today or whatever)'

    2) For each, Get Changes since (yesterday or today or whatever)

    3) For each of the items in your Column Names array, check to see if they have a true or false, and if they have a true ... do whatever your other update action is.

     

    You'd need to be careful on trigger conditions for any other flows, though, so they don't end up launching based on all these updates. 

  • ldelao15 Profile Picture
    10 on at

    I have changed this multiple times, but here is what I have 🙂 Thank you for any help you can provide!

     

    The apply to each that runs side by side is a condition to check another column and if so update with a formatted time frame. 

     

    ldelao15_0-1651175385574.png

     

    ldelao15_1-1651175402185.png

    ldelao15_2-1651175464932.png

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    So I've taken a look at what you have here, and really, I need more information about the scenario, to see if we can simplify it. 

    Is it - for example - if a status has changed to "Reviewed" then set the ReviewDate forward a year and set the LastReviewDate to the last modification date? 

    What kind of logic is there on the update? 

  • ldelao15 Profile Picture
    10 on at

    Hi there,

    I want a reoccurring event, that will look for a date in the "last reviewed date" column, then check to see the risk rating in the risk ranking column then take the last reviewed date, depending on risk ranking and add "last review date" + Year from that date, or Year and a half or two years, and place the date in the Next review column. 

     

    I appreciate all your help!

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Is there a status where it will know whether or not it has been reviewed and can update the new "Next Review" date? Or does it just assume it's been reviewed?

  • ldelao15 Profile Picture
    10 on at

    it will be a reoccurring review, it will be reviewed daily to see if any changes have been made. So daily check at 6am and calculation based on the fields provided above. This will not need to check for changes, just look at the last reviewed field, based on risk ranking, update the Next Review date column. 

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Oh, no I mean, reviewed by a human. Like, "Next Review" usually means that a human needs to look at it and read through it -- how can PA be sure that a human has done that before changing the "Next Review" date so that we're sure it was reviewed this year? (For example.)

  • ldelao15 Profile Picture
    10 on at

    I guess I am more so looking for it to run daily and not check if a human has updated, the last review field will be a manually updated field. so when someone updates it I want this flow to run early in the AM when the humans aren't here, so its updated daily.  I know I can set this up with " when last modified" and currently have one working, however, it will run when something is looked at or updated and it will cause Alarms and possibly start timing out. (i've had that issue in the past)

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Okay.  So you want:

     

    • Run daily.
    • Does "Review Date" = Today? If no, end. If yes...
    • Set "Last Review Date" to Today. 
    • Update the new "Review Date" based on the Risk Rating. (Ie, if Low, 1 year, if Medium, 6 months, if High, 2 months.)

    We can do that. 

    Step 1) Create a recurring scheduled daily flow - sounds like you've already got that - and initialize a "txtNewReviewDate" variable.

     

    Rhiassuring_4-1651520620019.png

     

     

    Step 2) Use a "Get Items" action, with a filter query:  ReviewDate eq ''  -- between the ''s, add an expression: formatDateTime(utcNow(),'MM-dd-yyyy') -- it will look like this:

    Rhiassuring_0-1651519394694.png

     

    Step 3) Add a condition - this will end the flow gracefully if nothing is due today. In the left hand side, put an expression:  length(outputs('Get_items')?['body/value']) - this is just counting if there's anything returned. The rest just looks like this:

    Rhiassuring_2-1651519634762.png

     

    Step 4) We can ignore the "No" side - it just ends if there's nothing. But on the "Yes" side, we will use the Switch action. We will evaluate on "Risk Value" - as soon as you enter this, it will become an Apply to Each - which we want to keep, because we don't know for sure if we'll only return a single value. We will make sure we have a "Case" named for each of our Risk types.

    Rhiassuring_5-1651520702786.png

     

    Step 5) Now we're going to drop a "Set Variable" action into each case, and we'll use that to calculate based on the case.  Each case will set the "txtNewReviewDate" variable, so we can use that later. Here's how the expressions look:

    High:  addtotime(utcNow(),2,'Month','MM-dd-yyy')

    Medium:  addtotime(utcNow(),6,'Month','MM-dd-yyy')

    Low: addtotime(utcNow(),1,'Year','MM-dd-yyy')

     

    Rhiassuring_6-1651521086379.png

     

     

    Step 6)  Now, outside of the switch, we add the "Update Item" action - and point it at the ID from your Get Items.

    For your "Last Reviewed Date", we're just going to click on the field, click on the Expression tab, and enter formatdatetime(utcNow(),'MM-dd-yyyy'). And that one is done. Easy. 
    And for your ReviewDate (mine is called DueDate in the screenshot, don't let it mix you up), we'll just add the variable. 

    Rhiassuring_7-1651521172239.png

     

     

    Annnnnnnd we're ready to flow. (I can't believe I just said that. 🙄)

    So here's my list before I run the workflow (I made 3 due today so they'll show up.) 

     

    Rhiassuring_8-1651521208097.png

     

    And here's after:

     

    Rhiassuring_9-1651521285982.png

     

     S U C C E S S 

     

    kermit-frog.gif

     

     

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    WAIT ... is it "if Last Review Date = Today"? ... I guess either way, the solution still works, just need to flip around some of the columns, if I got that incorrect...

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 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard