cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianS
Super User
Super User

Flow to check birthdays

HR would like me to use Flow to track the people who have Birthdays and send out an email listing today's each morning.

The first idea I had didn't work. I'm a little stuck on how to search the list to find them.

I have a list that includes Names and Birthdays. I have created a view with that info. After I set up a Daily run I put in a get Item step, but there is no dynamic data available for the Filter. Can I set up an array variable to hold the names with birthdays today?

I thought I knew how to set up that "loop" to look through the data, but I wasn't getting anywhere there either.

Any help is appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

@empty(triggerBody()?['Birth_Date'])

 

Try with this.

 

Or Birth Date is not equal to null

View solution in original post

10 REPLIES 10
CFernandes
Super User
Super User

@BrianS 

 

Can you have a look at https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Send-A-Happy-Birthday-Email-Messag... 

 

The YouTube tutorial at https://www.youtube.com/watch?v=QYMRfGOmSGI  

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

Thanks for the link - I did not find that template when I searched. However, I am getting an error when the Flow runs:

Unable to process template language expressions for action 'Condition' at line '1' and column '14697': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'.

I put in the field that I use for Birthday which is a date field.Flow_BDay_01.jpg

@BrianS 

 

Hey Mate,

 

From the Error it tells me the variable that you are using in formatDateTime expression is null.

 

I see you are using 'Compose' action above the condition and I assume it populate with correct date? If yes, try the expression below:

 

 

formatdatetime(<your variable> ,'yyyy-MM-ddThh:mm:ss')

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

You have any date empty? if you have any empty the conditional cannot perform the comparison. Try with two conditions, not empty and date equal

 

 

There are some in the list with blank birthdays - would that keep it from evaluating the non-blank ones?

I tried your idea - but possibly not correctly - also note below you can see the expression for the condition in the comments to that step.Flow_BDay_03.jpg

In your conditional, you keep trying check fields that dont have date with a date.

 

Try with two different conditionals, first "is not equal to empty", and IF TRUE check the dates. The empty fields go for NO and dont affect the flow.

I'm still doing something wrong! Not really my area of expertise I have to admit.

Now I'm getting this error:

Unable to process template language expressions for action 'Condition_2' at line '1' and column '14701': 'The template language function 'empty' expects one parameter: the object, array or string to test for emptiness. The function was invoked with '0' parameter(s).

Here is the portion of the flow:

Flow_BDay_04.jpg

Do I have the wrong formula to check to see if the field is empty? Am I checking the wrong entity?

@empty(triggerBody()?['Birth_Date'])

 

Try with this.

 

Or Birth Date is not equal to null

The check for null instead of empty did the trick! I had to change the Top Count to get it to do the entire list but all is working now

Thanks!

Where would I have put the 

@empty(triggerBody()?['Birth_Date'])

expression? I had thought I could cull the empty ones in the "Get Item" step, but I couldn't figure out how to do that. 

Is in advanded mode but this option has been removed from condition. Try this way

 

*es igual a = is equal to

 

Im from Spain 😛

 

condition.png

Helpful resources

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,571)