Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Manual trigger - send as attachments all files added to a SharePoint folder since the last time the flow ran

(0) ShareShare
ReportReport
Posted on by 37

Hi, i am creating a manual flow to send out an email with multiple attachments.

 

The attachments have to meet 2 criteria: 

- they were added to SharePoint since the last time the flow ran and

- file name must contain the word "Report

 

I know how to create a flow that send multiple attachments and to filter based on file names, however i am very stuck on the first step. I don't know how to make the flow only look at the documents added to SP since the last time the flow was triggered. 

 

Appreciate the help. 

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Manual trigger - send as attachments all files added to a SharePoint folder since the last time the flow ran

    Hi @Mirela_Raducanu 

     

    You need to write the below query in "Filter query" of "Get items" or get files action to get the files created in last 30 days:

    ManishSolanki_0-1693932158477.png

    Expression used for filtering past 30 days list items:

    Created ge '@{startOfDay(addDays(utcNow(),-30))}'

    You may replace utcNow() with the last run date time if you store it in custom list.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • Mirela_Raducanu Profile Picture
    37 on at
    Re: Manual trigger - send as attachments all files added to a SharePoint folder since the last time the flow ran

    Hi @ManishSolanki. Thanks for the tip. Do you know what the syntax for the date filter is? Let's say that the last run was 30 days ago, what would be the syntax to run the flow today? Thank you. 

     

     

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Manual trigger - send as attachments all files added to a SharePoint folder since the last time the flow ran

    Hi @Mirela_Raducanu 

     

    One possible solution, you may create a custom SharePoint list (lets say, FlowRunHistory) and save the last successful run time of the flow. Next time, whenever you run the flow just lookup the last run time and apply the filter accordingly to get the files or list items.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,026 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow