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 / Sending Email when Dat...
Power Automate
Answered

Sending Email when Date Meet Condition

(0) ShareShare
ReportReport
Posted on by 14

Hi everyone,

 

I am building a flow that automatically emails the form submitter if the 'Date of Event' is today.

 

I followed the following discussions: 

Here is my flow:

Screenshot 2023-10-05 152905.png

 

In the Filter Array, the Advance Mode shows @equals(addDays('1899-12-30', int(item()?['Date of Event'])), utcNow('yyyy-MM-dd'))

 

I created a test file with two rows of records, with the 'Date of Event' as today and another as next year. The flow ran successfully, but no email was sent out. 

 

What can I do to correct the flow? Thank you so much in advance!

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,360 Super User 2025 Season 2 on at

    Hi @pnguyen540 

     

    Thank you so much that it shows that, but here is what i would do first.

    above the condition add a Compose Action

    In the Expression put

    //I want to see this
    
    The output of your addDaysExpression and then a - and then utcNow('yyyy-MM-dd') 
    
    So essentially
    
    addDays(INSERT YOUR APPLY TO EACH DATE HERE, int(item()?['Date of Event'])) - utcNow('yyyy-MM-dd')
    
    So that you can see the actual values being compared. I believe they dont match, and its possibly the utcNow versus the date you are using and or, the int value you are getting from Date of Event


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • pnguyen540 Profile Picture
    14 on at

    Hi @FLMike 

     

    I apologize that I am slow to understand Power Automate. Can you explain what you mean by:

    • above the condition add a Compose Action: what condition box are you mentioning? Is it filter array?
    • INSERT YOUR APPLY TO EACH DATE HERE: is it '1899-12-30'? I tried to add the following to the Compose Action expression, that I put before the Filter Array: addDays('1899-12-30', int(item()?['Date of Event'])) - utcNow('yyyy-MM-dd') and it gave me the error. I believe I did not thoroughly understand your instruction.

    The date column in the Excel spreadsheet that I am pulling is formatted as YYYY-MM-DD.

    Thank you again for your help!

     

  • Michael E. Gernaey Profile Picture
    53,360 Super User 2025 Season 2 on at

    @pnguyen540 

     

    No you did fine, I needed to be a little clearer.

     

    Can you show me the actual Action you added so I can see what was typed in it, I think I know the issue and its on me

     

    Also, why do you put 1899 in there? Is that really the start date you want to add days too?

     

    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • pnguyen540 Profile Picture
    14 on at

    Hi @FLMike 

     

    Here is the screenshot of my Compose action and the error I received. My input in the expression was 

    addDays('2020-01-31', int(item()?['Date of Event'])) - utcNow('yyyy-MM-dd') 
     
    Screenshot 2023-10-05 181127.png
    Thank you again!
  • Michael E. Gernaey Profile Picture
    53,360 Super User 2025 Season 2 on at

    Hi, @pnguyen540 

     

    Sorry yeah thats why it was an error and thats on me to be more clear. You cannot type an entire expression(like this one) at one time. I know it sounds silly but you cant

     

    can you put this in

     

    concat(
    string(addDays('2020-01-31', int(item()?['Date of Event']))),
    '-',
    utcNow('yyyy-MM-dd') 
    )

     

    I do have a couple of questions though

     

    1. Is Date of Event an Actual Date? or a Number?

    2. If you are trying to compare the Date of Event to Today, why are you adding days to it? That would seem to me to make it never work and if its a Date, not a number, doing #1 will definitely mess it up.

    3. And where does the first Date come from the 2020-01-31 ??? 


    I guess I just dont understand since you should have a date stored, and you just want to compare that to todays date.. whats all the other stuff fore?

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

  • pnguyen540 Profile Picture
    14 on at

    Hi @FLMike 

     

    I appreciate your patience. To clarify, I am trying to compute the following: if the date is equal to today, email the person on the list.

     

    As for your questions:

    1. The 'Date of Event' is formatted as date YYYY-MM-DD in Excel
    2. My apology if it is not the correct way to approach. I simply follow the other two threads I found that are similar to what I try to accomplish.
    3. That date is from another example I try to copy 😞 I saw some people use 1899-12-30, while some use more recent dates in the expression. I wanted to see if it made any difference.

    What would be your suggestion for a flow that can send an email for those with dates matched today?

  • pnguyen540 Profile Picture
    14 on at

    After running the instruction you provided, I received this:

     

    Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

  • Michael E. Gernaey Profile Picture
    53,360 Super User 2025 Season 2 on at

    Hi @pnguyen540 

     

    No worries at all, but that is why you are having issues and it never triggers.

     

    Ok let me type what we will do instead.

     

  • Michael E. Gernaey Profile Picture
    53,360 Super User 2025 Season 2 on at

    Hi @pnguyen540 

     

    Yeah thats exactly what I figured would happen because you are trying to turn a Date into an INT and thats not possible

     

    One second Ill type what we will change

  • Michael E. Gernaey Profile Picture
    53,360 Super User 2025 Season 2 on at

    @pnguyen540 

     

    OK sorry for the delay I had to eat.

     

    I want you to change your Filter to the Following:

    Here is your Original

    FLMike_0-1696558707726.png

     

    I want you to change it by doing this

    1. Delete the add days please so there is nothing in that box at all

    2. Then I want you to click, so the Dynamic Properties/Expression window pops up

    3. You should be able to find the Date of Event Property under your List rows present in a table, click it and add that there

    4. make sure that in the Right side that you expression says

     

    utcNow('yyyy/MM/dd')

     

     

    I created this exactly field in my Excel and did all this just to validate it for you. 

    I list my rows

    I then use my filter, Just like I asked you to do, so it will look just like mine

    My Compose then does a length(value) to tell me how many rows it found

    Since I added a row with todays date, it returned 1 row

    FLMike_2-1696558986329.png

     

    FLMike_1-1696558879781.png

     

    If you do this it will work for you


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard