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 / Send email to specific...
Power Automate
Unanswered

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.

Categories:
I have the same question (0)
  • Verified answer
    Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    Hi @zw2348 ,

     

    Please try this:

    Heartholme_0-1652126065913.png

    1. Daily reccurance

    2. List rows present in table

    3. Then make a condition and add the A column in the first condition, this will automatically make an apply to each.

    4. Then make the current expressions:

    The date from your excel sheet: formatDateTime(items('apply_to_each')?['ACOLUMN'],'yyyy/MM/dd')

    The date today: formatDateTime(utcnow(),'yyyy/MM/dd')

    5. If yes, then send an email to the B column value like this (I just used the compose in the above picture to verify that it was working, it can be a nice step to do for you as well)

    Heartholme_1-1652126219570.png

    Let me know how it goes 😊

     

    { Please click Accept as solution ✔ if my post answered your question. }
    { This will in turn help others find solutions to similar questions. }

    Best Regards
    Heartholme

     

     

  • zw2348 Profile Picture
    91 on at

    Thank you so much for the reply. I am having major brain farts today, in the expression for formating the dates to compare it has to reference to today's date. The solution has 'ColumnA', in my sheet its named Due Date. So that I don't get an error, I need to rename this in the forumla to 'Due Date', correct?

     

    In the flow the Compose line - what goes there? Below is what I have currently. Thank you for all your support. 

    zw2348_0-1652129094858.png

     

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    Happy to help! Yes, rename this to 'due date'. You might have to use 'due_date' because of the space.

     

    In the compose I just put the 2nd column, with the email, but you can skip this and add it directly into the send email action.

     

    Let me know how it goes 😊

     

  • zw2348 Profile Picture
    91 on at

    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!

  • Heartholme Profile Picture
    1,278 Super User 2024 Season 1 on at

    @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

    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

    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

    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

    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

    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 🙂

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard