cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
monica95
Level: Powered On

InvalidTemplate Error when sending Happy Birthday Email through Flow

Hi, I'm trying to set up a flow on behalf of my company so that Microsoft will automatically send out a happy birthday email to our employees on their birthday. I used the template "Send a Happy Birthday email to employees on their birthday" and the only thing I did was add in the Site Address and the List Name.

 

 

In that same Sharepoint site and list, I have everything in there that Microsoft asks for "Email, Birthday Date, Last Name, First Name". I've altered between using first/last name and employee name, but both don't seem to work. Right now, I'm in the testing process and only have one person/birthday.

 

I get an error message that says "InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2589': '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.'." Please help if you can.

 

I've looked at others' messages on this topic and no one's solution seems to work for me. Thank you!

 

Screenshots of my list and my flow, as well as the error message, are below...

List.JPG

Flow.JPGError.JPG

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

Hi @monica95 

Thanks for the information on the expressions, and apologies. You had already included the format of your birth date I just didn't spot it.

So this should be a solution for you, please see below:Capture-167.png

here is the result:Capture-168.png

I have used "Compose Birth Date" to simulate your 02-19 then compared it.

so if you use this expression:

equals(items('Apply_to_each')?['Birthday_x0020_Date'], formatDateTime(utcNow(), 'MM-dd'))

Add it only on the left as I have above and make that equal to true, again same as I have it should return true.Capture-169.png

 

 

Hope that helps!

 

If you have found my post helpful, please mark thumbs up.

If this post has solved your problem, please click "Accept as Solution".

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

Super User
Super User

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

Hi @monica95 

I had said "I have used "Compose Birth Date" to simulate your 02-19 then compared it"

This is a new Flow just to help me make sure what I proposed you did, worked. Make sense?

 

Just you put this in the condition in your Flow and replace what you have:

Capture-169.png

equals(items('Apply_to_each')?['Birthday_x0020_Date'], formatDateTime(utcNow(), 'MM-dd'))

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

9 REPLIES 9
Super User
Super User

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

Hi @monica95 , thank you for the detailed image of your Flow.

How kind of you sending staff a Happy Birthday also!

 

So I can look at what the issue may be can you post 3 things please?

The Format of the birth date you have in your SP list?

Both the formateDateTime() expressions in your condition.

if you use </> above in the ribbon of the text editor you can post as code.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


monica95
Level: Powered On

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

Hi @AlanPs1,

 

1. The format of the birth day is MM-DD (picture below).

2. The condition is: 

Basic Mode -

formatDateTime(items('Apply_to_each')?['Birthday_x0020_Date'], 'MM-dd')
is equal to
formatDateTime(utcNow(), 'MM-dd')
Advanced Mode -
@equals(formatDateTime(items('Apply_to_each')?['Birthday_x0020_Date'], 'MM-dd'), formatDateTime(utcNow(), 'MM-dd'))
3. I'm not quite sure what the third question is asking. On which page should I be looking for a "</>"? I do not see this on my SharePoint List page or the Flow page.
 
Birth date.JPG
Super User
Super User

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

Hi @monica95 

Thanks for the information on the expressions, and apologies. You had already included the format of your birth date I just didn't spot it.

So this should be a solution for you, please see below:Capture-167.png

here is the result:Capture-168.png

I have used "Compose Birth Date" to simulate your 02-19 then compared it.

so if you use this expression:

equals(items('Apply_to_each')?['Birthday_x0020_Date'], formatDateTime(utcNow(), 'MM-dd'))

Add it only on the left as I have above and make that equal to true, again same as I have it should return true.Capture-169.png

 

 

Hope that helps!

 

If you have found my post helpful, please mark thumbs up.

If this post has solved your problem, please click "Accept as Solution".

Any other questions, just ask.

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

monica95
Level: Powered On

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

@AlanPs1, I don't understand. Did you create a new flow or go off the template? When I try to create a new flow from blank, I can't find the "Compose Birth Date" (see photo below). 

 

And even though it says Manually trigger, will it still check on it's on every morning?

 

Birth date.JPG

Super User
Super User

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

Hi @monica95 

I had said "I have used "Compose Birth Date" to simulate your 02-19 then compared it"

This is a new Flow just to help me make sure what I proposed you did, worked. Make sense?

 

Just you put this in the condition in your Flow and replace what you have:

Capture-169.png

equals(items('Apply_to_each')?['Birthday_x0020_Date'], formatDateTime(utcNow(), 'MM-dd'))

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


View solution in original post

monica95
Level: Powered On

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

@AlanPs1 

It says the post ran successfully, now I'm just waiting on the confirmation email. It's taking awhile to come, but if it doesn't, I'll post again. Thank you for your help!

 

Birth date.JPG

Super User
Super User

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

Hi @monica95 , You are most welcome!

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


SRK2405
Level: Powered On

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

Flow run successfully but I am getting false as expresion result and i am not getting mail for birthday.

 

SRK2405
Level: Powered On

Re: InvalidTemplate Error when sending Happy Birthday Email through Flow

hi @AlanPs1 , I have done with all task you have exolained, but i am geting false , as below. I have checked all conditions but problem is still same please help.false.JPG

 

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,563)