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 / Help sending mail if d...
Power Automate
Unanswered

Help sending mail if date is <= addDays(utcNow(),5,'yyyy-MM-dd')

(0) ShareShare
ReportReport
Posted on by 3

Greetings, absolute novice Power Automate here.

So I've looked at a couple of topics related to this but none have been of help. I've been trying to set a scheduled flow that runs at 8 am every day to check a table where I have historical bond purchases, their maturity date, ISIN, and quantity (how many of each bond are currently in the portfolio):

PinkCamel_2-1686753675383.png

I am using the "Apply to Each" action after "List rows present in a table" to check for each row if the date in column "Maturity Date" *items('Apply_to_each')?['Maturity Date'])* is less than today +5 days *addDays(utcNow(),5,'yyyy-MM-dd')*. Also running "List rows" with DateTimeformat "Serial number", running ISO 8601 makes the flow runs endlessly:

PinkCamel_3-1686754038736.png

 

 

PinkCamel_4-1686754709000.png

 

The flow runs 'successfuly' but all expression results are false, even though the last row in the table is in fact tomorrow (6/15/23 or 45092 as you can see in the output of "list rows" on the right), so the condition should be met:

PinkCamel_7-1686757148051.png
I would also need the mail to be sent only for bonds for which there is a "Quantity" greater than 0 (obviously, since bonds with a quantity of "0" are no longer in the portfolio), but I'm trying to get the date conditional sorted first. Any insights as to how to make this work are greatly appreciated!

Thanks!

 

 

 

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @PinkCamel 

     

    In the 'List rows present in a table' action, click on 'Show advanced options' and set 'DateTime Format' as ISO 8601 as shown below:

    ManishSolanki_0-1686758382826.png

    after Setting date time format flag, pls check your dates comparison.

     

    For condition, quantity > 0, pls add a new condition by wrapping column value in int formula to convert it into integer:

    ManishSolanki_1-1686758680970.png

    Expression used in left side to check the value of Quantity column is:

    int(item()?['Quantity'])

     

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

     

    Thanks

     

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    In your screen shot where it works but all the results are false, it looks like the spreadsheet is returning the serial date. You can use this expression to convert this to the ISO8601 date format and I think that will resolve your problem:

     

    addDays('1899-12-30', int(items('Apply_to_each')?['Date']), 'yyyy-MM-dd')

     

    Replace ['Date'] with the cell from your spreadsheet (Maturity date).

  • PinkCamel Profile Picture
    3 on at

    Hi, thanks for replying!
    After many hours I got it working. So as I mentioned, setting 'DateTime Format' as ISO 8601 did not solve it by itself. Oddly, what I think made it work was changing the table column "Maturity Date" format directly in the excel sheet to "yyyy-MM-dd" so that it matches with the expression's format. The "Quantity" expression on the other hand worked like a charm!

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard