Skip to main content

Notifications

Community site session details

Community site session details

Session Id : gkAsJxMLSJAfX2lBrBjYRP
Power Automate - Building Flows
Answered

Sending Email when Date Meet Condition

Like (0) ShareShare
ReportReport
Posted on 5 Oct 2023 22:57:58 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!

  • Verified answer
    Michael E. Gernaey Profile Picture
    42,027 Super User 2025 Season 1 on 06 Oct 2023 at 05:34:31
    Re: Sending Email when Date Meet Condition

    Hmm @pnguyen540  

     

    There is something not right. Your spreadsheet shows the Date

    But the filter gave a number. Please explain exactly how you created the file.

    Wait.. is that some kind of calculated column? I bet it is.. and I've been yanking my hair out for nadda. Thats not a date is it? Not really. Thats why it shows a number..

     

    Here is what I would ask.

     

    Open your Excel.

    Left Click on the Column Header on the column BEFORE the Date of Event

    Then right click the header (it should be highlighted) and then choose Insert a Column.

     

    That column should have like a name of Column1 or something, Please just remember what it is but leave it as is.

    In the new fields I want you to type 10/06/2023 for both rows (or however many rows you have).

    Then I want you to highlight those new values (just the new date column), and change the format to a Date, but I want you to pick the following

    FLMike_0-1696569989635.png

     

    Your dates should look like mine and the other column

    FLMike_1-1696570050081.png

     

    Now, go back into your Flow.

    -I need you to go to the List rows of a Table.

    -And I need you to go to the Table selector and click the down error. 

    -Then purposely choose the Enter a Custom Value option.

    -Immediately after, at the end of the line will be an X click it

    -This will take you out of Custom mode and should list the table as selectable

    -Select the Table again.

    -Now our flow will understand the new column.

     

    In your Filter, I want you to remove the Date of Event column and add the new Column1. It should look like it this. Ignore any dates in the Date of Event Column as we wont be using that Column.

     

    FLMike_3-1696570347232.png

     

    In the Filter you also need to change the utcNow() expression because the format is wrong, since the file has - in the date not /

     

    change this

     

    utcNow('yyyy/MM/dd')

     

    to

     

    utcNow('yyyy-MM-dd')

     

    If you do all that, it should work. 


    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 06 Oct 2023 at 03:09:11
    Re: Sending Email when Date Meet Condition

    Hi @FLMike 

     

    The data comes from a spreadsheet we collected for training events. Here is what it looks like in my Excel spreadsheet.

     

    Screenshot 2023-10-05 200756.png

    Is there a way to convert it to be properly formatted for the flow?

  • Michael E. Gernaey Profile Picture
    42,027 Super User 2025 Season 1 on 06 Oct 2023 at 02:59:53
    Re: Sending Email when Date Meet Condition

    Hey @pnguyen540 

     

    Those aren't dates. Where did this data come from? That will never work. 

  • pnguyen540 Profile Picture
    14 on 06 Oct 2023 at 02:43:15
    Re: Sending Email when Date Meet Condition

    Hi @FLMike 

     

    So I redid the flow based on your instructions. Here is what I have.

     

    Screenshot 2023-10-05 193947.png

    It ran successfully, but no email was sent. So I went into the particular run to see what happened. I noticed that the Filter Array Output did not have the date that matched today. And the date is displayed not in the format yyyy-MM-dd as I formatted in Excel.

     

    Screenshot 2023-10-05 193050.png

     

    What could be the next steps to proceed? Thanks again!

  • Michael E. Gernaey Profile Picture
    42,027 Super User 2025 Season 1 on 06 Oct 2023 at 02:22:11
    Re: Sending Email when Date Meet Condition

    @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

  • Michael E. Gernaey Profile Picture
    42,027 Super User 2025 Season 1 on 06 Oct 2023 at 02:06:13
    Re: Sending Email when Date Meet Condition

    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
    42,027 Super User 2025 Season 1 on 06 Oct 2023 at 02:04:51
    Re: Sending Email when Date Meet Condition

    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.

     

  • pnguyen540 Profile Picture
    14 on 06 Oct 2023 at 02:04:00
    Re: Sending Email when Date Meet Condition

    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.'.

  • pnguyen540 Profile Picture
    14 on 06 Oct 2023 at 01:53:08
    Re: Sending Email when Date Meet Condition

    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?

  • Michael E. Gernaey Profile Picture
    42,027 Super User 2025 Season 1 on 06 Oct 2023 at 01:38:07
    Re: Sending Email when Date Meet Condition

    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

     

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!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 81

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 70 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard