cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
leeleeisfree
Frequent Visitor

Sending Birthday and Work Anniversary Emails to employees - Issue with dates

Hello, 

 

I have successfully created both a birthday and anniversary flow to be emailed to employees on their birthday and work anniversary. However, the flow is also sending it to individuals who have similar but not exact dates. 

 

For example:

John Doe's birthday is today 1/5 (January 5th) the flow emailed him as well as Mary Smith who's birthday is 5/1 (May 5th) how do I keep it from doing that? 

 

I've attached how I've set my date format up as well as my condition. The first output in the condition step is "set month" and the second is "set date" 

 

Thank you!! 

 

 

 

Date FormatDate FormatSplitSplitSet MonthSet MonthSet DaySet DayConditionCondition

2 ACCEPTED SOLUTIONS

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @leeleeisfree,

 

My guess is that you need to apply some datetime formatting to the birthday values. Can you show a bit more details of your flow. For instance a screenshot of your condition action?

 

Btw, this Power Automate blog from @AlanPs1 has some good expression examples on how to use formatting with birthday fields.

 

The approach is basically:

formatDateTime(body('Get_user_profile_(V2)')?['birthday'], 'MM-dd')

equals

formatDateTime(utcNow(), 'MM-dd')

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Send-A-Happy-Birthday-Email-Messag...



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

@leeleeisfree , as @Expiscornovus  has suggested, please modify your condition as follows:

 

on left side

formatDateTime(items('Apply_to_each')?['DOB'], 'MM-dd')

on right side

formatDateTime(utcNow(), 'MM-dd')

so your condition will look as follows:

annajhaveri_0-1609932863883.png

 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

5 REPLIES 5
Expiscornovus
Super User
Super User

Hi @leeleeisfree,

 

My guess is that you need to apply some datetime formatting to the birthday values. Can you show a bit more details of your flow. For instance a screenshot of your condition action?

 

Btw, this Power Automate blog from @AlanPs1 has some good expression examples on how to use formatting with birthday fields.

 

The approach is basically:

formatDateTime(body('Get_user_profile_(V2)')?['birthday'], 'MM-dd')

equals

formatDateTime(utcNow(), 'MM-dd')

https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Send-A-Happy-Birthday-Email-Messag...



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


annajhaveri
Community Champion
Community Champion

@leeleeisfree can you please share the screenshot of the flow to see where exactly the issue is, there must be something wrong related to data you are fetching for birthdays/anniversaries.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

I have edited my post to include screenshots. Thank you so much!!! 

I have edited my post to include screenshots. Thank you!!!! 🙂 

@leeleeisfree , as @Expiscornovus  has suggested, please modify your condition as follows:

 

on left side

formatDateTime(items('Apply_to_each')?['DOB'], 'MM-dd')

on right side

formatDateTime(utcNow(), 'MM-dd')

so your condition will look as follows:

annajhaveri_0-1609932863883.png

 

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (4,047)