Celebrating milestones with SharePoint, Flow, and Delve

Learn Expert

Recently, I’ve been asked if there was a simple way to provide birthday reminders on a SharePoint intranet without any customizations.  Well, after looking at some of the options available in SharePoint Modern sites, it’s possible (with the help from Delve and Microsoft Flow).

 

In this article, I demonstrate how to showcase the names of people who have a birthday today.  I have not included the year or age as most of us don’t age beyond 25 anyways.  One thing that I really like about this approach is that the birth date is set in Delve and give each user the choice whether to share it with others or not.  If not, then their name will not appear on the SharePoint site.  Other items that this solution can be extended to is to use the hire date and highlight specific anniversary milestones. 

 

Setting the Birthday in Delve

As I’ve mentioned above, one of the first steps was to set the birthdays in Delve.  To set your birthday, click the Update profile button when you first visit your profile page.  This will take you to a page that looks like the one below.  Each user can do this themselves. 

Delve.PNG

 

What is important is that the icon on the right should show a globe to indicate that everyone can see the birthday.  If it’s set to a lock, then only the user themselves can see it.

Birthday.PNG

 

That’s all you need to do in order for your birthday to show up in SharePoint.  You can also use the employee's Hire Date to display work anniversaries.  To edit a user's hire date,

  1. Navigate to the SharePoint admin center (https://<your domain>-admin.sharepoint.com/_layouts/15/tenantprofileadmin/manageuserprofileserviceapplication.aspx)
  2. Select Manage User Profiles
  3. Using the Find profiles, edit search for a user who's hire date you want to set or change
  4. Hover on top of the name of the user you want to change and from the drop-down, select Edit My ProfileEdit Profile.PNG

     

  5.  Scroll down and select a date for Hire Date.  Make sure that Everyone is selected in the drop-down beside the date.
    Hire Date.PNG

     

     

NB: Now that you know my birthday, I expect at least a birthday card or like on this article on that day :smiling_face_with_smiling_eyes:

 

Creating the Celebrations web part in SharePoint and List

 

As I decided to go with a no-code solution, I had to stick with one of the out of the box web parts that would provide a decent look.  So, I actually chose an events list.  I created a new list called Celebrations, which is an out of the box Calendar list and linked it to the Events web part as shown on the right side of the page.Modern.PNG

 

The flow ensures that only users who have entered their birthdays and have a birthday on a specific day show up in the list that day.  I also uploaded an image called confetti.png onto my site to be used as a banner image for the events.

 

Building the Flow

The flow is somewhat straight forward and is broken down into three parts

  1. Daily timer trigger to kick-off the workflow
  2. Delete all existing celebrations in the Celebrations list
  3. Add users who’s birth day and month match today’s date into the Celebrations list

Trigger

The Flow begins with a trigger being set to kick-off the flow each day at midnight.  Make sure to set your time zone, otherwise you may have birthdays start and end time wrapping a calendar day.

 Trigger.PNG

 

Delete Items

Nothing fancy here.  Just a loop that iterates through the Celebrations list and deletes all the items found

 

DeleteItems.png 

 

Add Celebrations

This is where the good stuff happens.  The action starts by searching all Office 365 users that match a given term by display name, given name, surname, mail, mail nickname or user principal name.  To keep it simple, I’ve included the search term com, which appears in everyone’s email.

 

 

Search.PNG

 

Next, I use a comparison between today's date and a date that is available in the user's profile.  As I've mentioned earlier, I have the user's birthday and hire date that I can set and to no surprise, the same fields are available as dynamic content from the Get user profile (V2) action. Fields.PNG

 

 

In this article, I check to see if the birth day and month are today and that the birth year is not 0001, which indicates that the user didn’t provide a birthday in their Delve profile.  To do so, I’ve used the following expression

 

@and(equals(substring(body('Get_user_profile_(V2)')?['birthday'], 5, 5) , substring(utcnow(),5,5)), not(equals(int(substring(body('Get_user_profile_(V2)')?['birthday'],0,4)), 0001)))

 

And finally, I add an item for each match into the Celebrations list.  For the Start Time and End Time, I set them to go from midnight until just before midnight the next day

 

Start Time  

concat(substring(utcnow(),0,10),'T00:00:00Z')

 End Time

concat(substring(utcnow(),0,10),'T23:59:59Z')

 

CreateItem.PNG

 

 

Remember the confetti.jpg image I uploaded into the document library?  You can see it being referenced in the Banner URL field.  This image appears at the top of each celebration event created.

 

 

Event Page.PNG

 

 

Limitations

With the modern Events web part, when there are no celebrations on a day, it shows the three default events, which is not ideal.  I’d rather the entire webs part be hidden in that case.  As well, the Flow action does not allow to specify full-day events, requiring you to enter a start and end time.

11 Replies

Maybe that would deserve a proper blog article... anyway thanks for sharing. I tried already to use this web part before but I found out that it was not ideal.

 

So far my not much code solution was to use search web part with some custom query and template, but that's for classic SharePoint.

 

Maybe at some point I will code the SPFx web part, as I think I already have the search API query somewhere to retrieve the users with upcoming birthday. However using Flow to put the result in a list once a day might be better in term of performance, instead of having the search query against all users happening every time a user goes to the intranet page.

 

 

Thanks for the feedback, @Aim Zaab.  Where would you like to see a full blog article posted on this topic?  Happy to add it.

Maybe on medium.com, just thinking that it could be valuable info and I think it might just get lost here.

I agree, a more extensive walkthrough would be greatly appreciated! :)

Hi,

 

This looks like a great idea, and I'm very hopeful I can use it. However, the Search for Users action is not performing as your article suggests. You use "com" as the search term assuming it will return all users since all users have .com in their e-mail address.

 

This is not working for me. Using com as the search term only returns 26 users instead of the expected ~5000. It appears the domain part of the mail or user principal name is not being used in the search.

 

Do yo have another way to return all users?

 

Thanks,

 

Ron

Hi @Ronald Rohlfs, I haven't come across this issue as my tenant doesn't have that many users.  Did anyone else experience this limitation?

Hi Haniel,

I like this non-coded way of showing Birthdays on a SP site but I have an issue. In the part when Get user profile (V2) comes in, I can't find Birthday inside "Dynamic Content". Are you familiar with this?

I'm having trouble get a list of all the users.  I've used the "org" criteria similar to your "com" but it looks like they've changed the behavior.  I think they are screening out the last part of the email address and looking for things before the @ sign.  Any ideas?

I have the same issue. @John Warner 
Not returning the users with com. 

@Haniel Croitoru 

 

I feel like there are a lot of missing steps here that need to be elaborated on. I assume you took the approach that many people may be above average with using flow, but there are many who would like this approach, but need you to break it down step by step. Is there another article out there that does this or maybe even a video? I've created a new calendar, but that doesn't show up as a list in Flow so I can't even begin the delete piece. Looking then at pulling in celebrations, I don't know how to start there. 

@martinb8 @Danie Claassen @John Warner sorry for the late reply.  Please reach out to me at hanielc@gmail.com and we can discuss.