Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Send email to specific person if date matches

(0) ShareShare
ReportReport
Posted on by 91

Hello,

 

I am looking to build a flow and not sure where to start. I'm a novice when it comes to coding/flows.

 

I have an excel sheet that contains a dates. I have simplified it to where the flow would only have to scan and match one column with the current date and send an email to a corresponding person.

 

In clarity - If Cell A1 equals Today, then Send email to cell B1. The flow would check daily.

 

Thank you in advance, you guys have been great so far.

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: Send email to specific person if date matches

    Hahah, great to hear @Wand2023 😄

  • Wand2023 Profile Picture
    5 on at
    Re: Send email to specific person if date matches

    Thankyou @Heartholme, this saved me from pulling my hair out! 😅

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: Send email to specific person if date matches

    @zw2348 Great! 😄 Yes, working with excel can be a bit frustrating at times, since there are a lot of details which can cause errors. 

  • zw2348 Profile Picture
    91 on at
    Re: Send email to specific person if date matches

    Finally figured it out.. I rebuilt the flow and tinkered with the excel sheet and it finally works! Part of the issue seemed to be the excel sheet wasn't in the text for formating. Thank you for all your support, I have 2 small things to add but I'm waiting for IT to add me to a mailbox 🙂

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: Send email to specific person if date matches

    Seems like the condition/reformatting dosen't work on blank cells.

     

    Try this:

     

    1. if(equals(formatDateTime(items('apply_to_each')?['DueDate'],'yyyy/MM/dd'), ''), 1998/02/02, formatDateTime(items('apply_to_each')?['DueDate'],'yyyy/MM/dd'))

     

    or this:

     

    2. if(equals(items('apply_to_each')?['DueDate'], ''), 1998/02/02, formatDateTime(items('apply_to_each')?['DueDate'],'yyyy/MM/dd'))

     

    Can't remember if '' is the value of blank cells, but I guess if there is a "blank" value from the excel cell output, put it between the '' in the expression.

     

    Hopefully this solve every case.

     

    Did you try this for the list rows present in table?

     

    Heartholme_0-1652300846997.png

     

    That should remove the blanks.

     

    Br

    Heartholme

  • zw2348 Profile Picture
    91 on at
    Re: Send email to specific person if date matches

    I am lost.. again :).

     

    I have the flow working all the way up to formatting the date to match today's date. If I am reading the formula correctly, it looks like its not finding the column in the table. I removed the space so the column name is 'DueDate'.

     

    Edited formula: formatDateTime(items('apply_to_each')?['DueDate'],'yyyy/MM/dd')

     

    Error "

    InvalidTemplate. Unable to process template language expressions for action 'Condition_2' at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string '43258' was not valid. The datetime string must match ISO 8601 format.'."

     

    zw2348_0-1652287277580.png

    zw2348_1-1652287312695.png

     

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: Send email to specific person if date matches

    Hi @zw2348 ,

     

    Sure, no problem!

    You could try to filter these out in the filter query, check out this:

    https://tomriha.com/remove-excel-rows-with-empty-value-with-power-automate/

     

    Or you could have a condition to filter out blank reponses with something along these lines:

    https://powerusers.microsoft.com/t5/General-Power-Automate/skip-blank-column/td-p/120516

     

    I don't have time to go into more detail right now, but can look at later if you still run into issues here 😊

  • zw2348 Profile Picture
    91 on at
    Re: Send email to specific person if date matches

    Okay, can I bug you for one more solution.. the flow ran yesterday, as I received an email. The flow seems to fail due to not every cell having a date listed, or I think. I'm getting the following error.. 

     

    Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string '' was not valid. The datetime string must match ISO 8601 format.'.

     

    I have the table for both dates as yyyy/MM/dd in the excel sheet. Could this be failing due to blanks? 

     

    zw2348_0-1652202105118.png

    zw2348_1-1652202138800.png

     

     

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at
    Re: Send email to specific person if date matches

    @zw2348 

     

    Perfect. Glad to hear 😄

     

    My bad on the Due_Date, on some queries it's needed when dealing with spaces, in variables/outputs and such. Could'nt remember how it was for excel.

  • zw2348 Profile Picture
    91 on at
    Re: Send email to specific person if date matches

    Well I did something wrong, it came back with the following error. 

     

    Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

     

    Oh what.. I had it as Due_Date and it like Due Date.. this is solved. You're the best!

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