Skip to main content

Notifications

Power Automate - Building Flows
Answered

How to pick up only new files in one drive folder in power automate

(0) ShareShare
ReportReport
Posted on by 75

Hello, 

 

I am having a flow to read multiple files from folder in OneDrive and update the data in SharePoint.

But flow picks up the files which were already updated in SP every time it runs. (As expected ) 

 

Is there anyway to control the flow to pick up only the new files added or only the files modified recently in folder?  I know this is possible to do if my files are in Share Point Library with status column.

 

But not sure how I can do the same for the files in OneDrive folder.

 

Thanks

 

 

  • Sivaperumal31 Profile Picture
    Sivaperumal31 75 on at
    Re: How to pick up only new files in one drive folder in power automate

    HI @grantjenkins , 

     

    Thank you , It worked to pick up the latest files modified in last 24 hours.

    But I am unable to assign the content of excel file to share point item list inside the loop , Properties from "List rows present in table" are not visible to map in "Create Item" List.

     

    Sivaperumal31_0-1678069896079.png

     

    But when I used "List files in Folder" from one drive instead of " Get files Property"  this problem is not there.(As below )

     

    Sivaperumal31_1-1678070204789.png

     

    Update : I managed to figure out how to get current item with simple expression for each column when creating the item in share point list like below . But i really wonder how it works with one drive but not using Get file property. 

     

    Sivaperumal31_0-1678077645167.png

     

     

  • Verified answer
    grantjenkins Profile Picture
    grantjenkins 11,057 on at
    Re: How to pick up only new files in one drive folder in power automate

    You can use the SharePoint connector Get files (properties only) since OneDrive is essentially SharePoint behind the scenes with regards to file storage. You can use any of the SharePoint connectors for OneDrive.

     

    grantjenkins_0-1677768385046.png

     

    For Site Address you will need to paste your OneDrive URL as a Custom value.

     

    For your Library Name you will need to type Documents as a Custom value (Documents is your My files).

     

    For Limit Entries to Folder, you can navigate to your OneDrive folder.

     

    For Include Nested Items, select Yes.

     

    For Filter Query paste in the following expression.

    //FSObjType eq 0 means only return files (not folders)
    
    //The Modified part will return files that were modified in the last 24 hours only
    
    FSObjType eq 0 and Modified gt '@{addDays(utcNow(), -1)}'

    .

    You can then loop over each of the files, or create an HTML table to send via email, etc.


    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • OkanMTL Profile Picture
    OkanMTL 703 on at
    Re: How to pick up only new files in one drive folder in power automate

    Does the next topic help you?

    https://powerusers.microsoft.com/t5/Building-Flows/Create-an-auto-email-at-the-end-of-the-day-a-sharepoint-file-is/td-p/1453795

     

    Good luck

  • Sivaperumal31 Profile Picture
    Sivaperumal31 75 on at
    Re: How to pick up only new files in one drive folder in power automate

    Hi @OkanAT , 

    Yes indeed, its helpful.

     

    But my flow is schedule to run every day at the end of business hours. In a day, there will be many files modified and new files created. So I do not want to clutter the flow as the flow will contain email alert step too . Hence I would need to run once a day.

     

    Thanks

     

    Thanks.

  • OkanMTL Profile Picture
    OkanMTL 703 on at
    Re: How to pick up only new files in one drive folder in power automate

    Hi,

     

    You can start the flow with the trigger "When a file is created" by Onedrive. So whenever a file is added to the folder, your flow will trigger only for that file. So this will pick up all new files added to onedrive..

    Then >

    You could copy this flow, and replace the trigger with the onedrive action "when a file is modified"

     

    Hope this helps.

     

    Good luck.

     

     

    Good luck.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard