Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Sharepoint Library List Email if one condition no email if none in library

(0) ShareShare
ReportReport
Posted on by 7

I know this is right on the tip of my tongue so to speak, but I just can't seem to get it fixed.

 

I have a SharePoint library and one of the columns has a "Next Review Due" date in it. Items must be reviewed annually. So I have it set to send out emails to document owners 30 days before the next review date. That part of the flow seems to be working fine. But I want an email sent every time the process is run and if there aren't any documents due to review in the next 30 days, I want the email to say that.

 

Currently the process is reviewing each line and sending an email for each document on whether or not it's due in the next 30 days. I know this has to do with the Foreach and where my condition is, but I don't know where to put the info. 

 

mtl_0-1675784759922.png

 

  • Verified answer
    fchopo Profile Picture
    7,968 Super User 2025 Season 1 on at
    Re: Sharepoint Library List Email if one condition no email if none in library

    Hi @mtl 

    So you mean you want to send a single email with all items that due on next 30 days. Therefore you could use an OData filter to get those, and build an HTML Table with the output:

    html-table.png

     

    1) Get items where NextReviewDate is less than 30 days from today.

    2) If there are no items (length of the output of previous step equals 0) -> Send email no items

    3) If there are, then build an HTML table with some of the fields, and send it by email.

     

    Hope that helps!

    Ferran

  • mtl Profile Picture
    7 on at
    Re: Sharepoint Library List Email if one condition no email if none in library

    Hi @fchopo 

     

    It cannot be blank. Basically what I would like it to do 2 things:

    1. is for it to look at all the next review dates and if there aren't any in the next 30 days, then it sends an email saying there aren't any.
    2. If there are ones due in the next 30 days, then it sends an email. 

    Number 2 works fine currently. It's the Number 1 that I can't seem to get to work. 

  • fchopo Profile Picture
    7,968 Super User 2025 Season 1 on at
    Re: Sharepoint Library List Email if one condition no email if none in library

    Hi @mtl 

    The formulas look fine, so may be the problem is in your data (can the NextReviewDate column be empty?).

  • mtl Profile Picture
    7 on at
    Re: Sharepoint Library List Email if one condition no email if none in library

    Yes!

    formatDateTime(outputs('Compose'),'yyyy-MM-dd')
     
    addDays(utcNow(),30,'yyyy-MM-dd')

     

  • fchopo Profile Picture
    7,968 Super User 2025 Season 1 on at
    Re: Sharepoint Library List Email if one condition no email if none in library

    Hi @mtl 

    Could you share the expressions you're using in the condition (formatdatetime... and AddDays...) ?

    Regards,

    Ferran

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1