cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rwittels
Responsive Resident
Responsive Resident

Birthday email listing all birthdays in a single email

There are many tutorials and templates explaining how to send out an email to someone on their birthday. We prefer to send a single email out to the company listing all people who are celebrating their birthday on that day. I found this great template: Send wishes to employees by email as per the birth date in SharePoint list but I would like to know how to list the names of all the people celebrating birthdays in the body of the email. The email would then go out to the same distribution list each day. So instead of "Happy Birthday FirstName" I would prefer, "We would like to wish the following people happy birthday today:" and then list the full names.

2 ACCEPTED SOLUTIONS

Accepted Solutions
manuelstgomes
Community Champion
Community Champion

Hi @rwittels 

 

Sure let's do this :).

 

You can start with the same template. Remove the variables from the send email and put it outside the "For Each". Then add a variable and, in the place where the "Send Email" was put, an append variable with the person's name. Where you see "<name>" you should put the value that comes from your SharePoint. the "<br>" is to have one name per line. The result is like this (2 prints because the Power Automate would not fit in the same print).

Screenshot 2021-02-01 at 16.28.52.pngScreenshot 2021-02-01 at 16.28.47.png

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

manuelstgomes
Community Champion
Community Champion

Hi @rwittels 

 

How many rows you have on that list? Please note that the "Get Items" only returns the first 100, so the people that have birthdays may be outside that range.

 

I would recommend the following:

1. Add a sort in your "Get Items" by the birthday Date. You can check the name of the field when you run in the outputs section. The expression should be "Date asc" in the "Order By". 

2. Limit to 50. I don't think you would have 50 people with the birthday the same day, and then you'll fetch less data making your Flow faster. If you think the number is lower, you can define a lower number. 

 

Here's what to to do:

Screenshot_2021-02-04_at_07_57_41.jpg

 

Fetch the information from the last run:Screenshot_2021-02-04_at_07_58_32.jpgScreenshot_2021-02-04_at_07_58_42.jpg

 

Copy the name exactly as you find it in the text. Some lists have spaces and other characters, so it's important to use the name that you find there so that the sort will work..

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

23 REPLIES 23
manuelstgomes
Community Champion
Community Champion

HI @rwittels 

 

You need to adapt a little to the strategy. Currently, the strategy is:

  1. Fetch all birthdays
  2. Loop all of them
  3. For each, send an email.

 

What you need to do is the following:

  1. Create a variable that is the "body" of the text
  2. Fetch all birthdays
  3. Loop all of them and add them to the variable
  4. Outside the loop, send one email with the body that you created.

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Thank you. This makes perfect sense. I am new to Power Automate so any guidance on how to actually do this would be appreciated.

manuelstgomes
Community Champion
Community Champion

Hi @rwittels 

 

Sure let's do this :).

 

You can start with the same template. Remove the variables from the send email and put it outside the "For Each". Then add a variable and, in the place where the "Send Email" was put, an append variable with the person's name. Where you see "<name>" you should put the value that comes from your SharePoint. the "<br>" is to have one name per line. The result is like this (2 prints because the Power Automate would not fit in the same print).

Screenshot 2021-02-01 at 16.28.52.pngScreenshot 2021-02-01 at 16.28.47.png

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

You have been very helpful. Thank you. I will try this solution.

 

UPDATE: The flow doesn't work correctly. I receive an email with only the first name that matches. There should be 4 more names in the list. The other problem is that I receive the email constantly until I cancel the test. I received the mail about 30 times before I cancelled the manual test. Do I have to tell it to only send once or is it a loop issue?

Here is my flow:

Flow.jpg

manuelstgomes
Community Champion
Community Champion

HI @rwittels 

 

Can't see correctly in the print you shared, but is the "Send an email" outside the "Apply to Each"?

This is the only thing that would explain just one name and several emails.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

I moved the email below Append to string variable, inside Apply to each. I only receive one email now but with only one name. The flow fails with this error though: "Action failed. An action failed. No dependent actions succeeded." All components have green ticks though.

rwittels_0-1612267976491.png

manuelstgomes
Community Champion
Community Champion

Hi  

 

No, I mean moving the "send email" entirely outside the "Apply to Each.

 

The reason is that you're fetching one person, appending it, and sending the email. You need to fetch one person and append (inside the apply to each) and then outside send only one email with everything.

 

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.

Cheers

Manuel

 

OK. That's how I had it but the mails kept coming. I moved the email output back to where it was but now I get this "Action failed. An action failed. No dependent actions succeeded." No idea what's wrong. I am going to build the flow from scratch and see what happens.

rwittels
Responsive Resident
Responsive Resident

This is so strange. I have not changed anything but I keep getting "ActionFailed. An action failed. No dependent actions succeeded." on the Apply to each step. I will look up the error. I don't know what has changed.

rwittels
Responsive Resident
Responsive Resident

I am getting this error:

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

My sharepoint list dates are formatted as dd/mm/yyyy and the conditional expression in the flow is

formatDateTime(outputs('Compose'), 'MM-dd') is equal to formatDateTime(utcNow(),'MM-dd')

Could my problem be with the date format in my list or can I change the conditional statement to match my date format?

rwittels
Responsive Resident
Responsive Resident

OK. I think I resolved the date issue by applying the ISO 8601 format to my date column. The flow runs and succeeds without errors:

FlowSuccess.png

The big problem is that I am getting no names returned in the email. The one name that appeared to be matching the date and returning as a result was at the top of my SharePoint list. I moved it to the bottom of the list so that the top record is not a date match. The Birthdays string is empty. Does this mean that it is not looping through the list and only checking the first record in the list?

rwittels
Responsive Resident
Responsive Resident

I ran it again this morning. It sent a mail with one name again.There should have been 3. The name it added was the first date match for today. The name was also in the middle of the list so it is not a top of list issue. The flow is obviously not appending Titles from subsequent date matches to the Birthdays string variable.

rwittels
Responsive Resident
Responsive Resident

Have read a lot on this today. Still no solution though. A few articles suggest that I should be composing the Birthdays variable prior to sending the email. I tried this inside the loop and outside but nothing changed. Other articles speak about using the JOIN or CONCATENATE expressions but I think that applies more to arrays. I'm really stuck here. No idea.

rwittels
Responsive Resident
Responsive Resident

I have read many articles on this and it appears that appending in a loop just does not work. Unless someone reads this and has a solution, I will take it that Power Automate is the wrong platform to configure this type of flow.

manuelstgomes
Community Champion
Community Champion

Hi @rwittels 

 

How many rows you have on that list? Please note that the "Get Items" only returns the first 100, so the people that have birthdays may be outside that range.

 

I would recommend the following:

1. Add a sort in your "Get Items" by the birthday Date. You can check the name of the field when you run in the outputs section. The expression should be "Date asc" in the "Order By". 

2. Limit to 50. I don't think you would have 50 people with the birthday the same day, and then you'll fetch less data making your Flow faster. If you think the number is lower, you can define a lower number. 

 

Here's what to to do:

Screenshot_2021-02-04_at_07_57_41.jpg

 

Fetch the information from the last run:Screenshot_2021-02-04_at_07_58_32.jpgScreenshot_2021-02-04_at_07_58_42.jpg

 

Copy the name exactly as you find it in the text. Some lists have spaces and other characters, so it's important to use the name that you find there so that the sort will work..

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

This works! However, "Top count" is "Total number of entries to retrieve", so I set that to my list length which is 390 and the email returns all the correct names for the day. When I set Top count to 100 initially, it only emailed 2 names which were within the first 100 records on my list.

I can confirm that this now works and I have marked it as the solution. Thank you. I have learned a lot.

 

manuelstgomes
Community Champion
Community Champion

AWESOME 🎉

almapete21
Helper II
Helper II

Hi. I have been using this one and I only have one problem: it still sends me an e-mail even if no one in the SharePoint List has a birthday on that day. Is there a workaround where it will only send an email if someone in the List has a birthday? Hoping this would be noticed. 😢

Hi. I solved this by checking whether the Birthdays string has any content in it (length is greater than 0). Add a condition right at the end and only send an email if the length of the Birthdays string is greater than 0.

Condition.jpg

Helpful resources

Announcements

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!    

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Users online (5,021)