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 / Duplicate Email Notifi...
Power Automate
Unanswered

Duplicate Email Notifications

(0) ShareShare
ReportReport
Posted on by 12

Hi, 

 

I have a flow which uses the action 'List files in folder', it then has a condition to check if the last modified date = today's date, if yes then add a row to a Power Bi dataset and then send an outlook email.

 

The problem I am having is each time the flow runs I get a email with all the files for today and not just the ones since the last flow ran.

 

I apologise if this is a really basic concept, but how can I set it up so I only receive emails about those files added since the last flow ran?

 

Thanks in advance

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

     

    @Stephen1606 You may be able to use the addhours() expression to alter your condition.  For instance, if your flow is recurring every hour or so you can use addhours() or utcnow() to see if the modified field is less than an hour old, therefore new.  So it will be like saying "check if Created >= utcnow()-1hr"  That's completely not how you write it, but well, I'm super new at this too.

     

    SEE https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/

     

    This one helped out too: https://powerusers.microsoft.com/t5/Building-Flows/Calculation-with-dates-in-Flow-is-not-working/m-p/23694/highlight/true#M674

     

  • v-yuazh-msft Profile Picture
    on at

    Hi @ Stephen1606,

     

    Could you please share a screenshot of the configuration of your flow?

    Where is the folder that you mentioned saved in? Is it saved in your Onedrive for business?

    Do you want the flow to send an email with all the files' name that are added to folder since the last flow ran?

    How frequency would you flow run to get the files in the folder and send the email

     

    I would offer you a workaround, please refer to screenshot below to create the flow:

    1.png2.png

    Note:

    1.The flow would run with a frequency of two hours.you could modify the frequency as your needs.

    2.The expression in the condition would filter all files that are added to folder since the last flow ran, the expression as below:

    @greater(items('Apply_to_each')?['LastModified'], addHours(utcNow(), -2))

     

    If modify the frequency of six hours, you should modify the expression as below:

    @greater(items('Apply_to_each')?['LastModified'], addHours(utcNow(), -6))

     

    You could refer to link below to learn more about the workflow definition language:

    https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

     

     3.The expression in the condition 2 would check whether there are files be added to folder since the last flow ran, and if there are files be added to folder since the last flow ran, the flow would send the email notification, the expression as below:

    @not(equals(length(variables('All files name')), 0))

     

    4.The expression in the compose would convert the files' name to string, the expression as below

    string(variables('All files name'))

     

    The flow would run successfully as screenshot below:

    3.png

     

     

     

     

    Regards,
    Alice Zhang

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard