Prerequisites
- You are using SharePoint online (Office 365) environment
- You have a custom user profile property either synced from your Active Directory or created from SharePoint Online admin portal and you want to show it in ShortPoint using People Search. Please check following article on How to Create a Custom User Profile Property in SharePoint Online
- You have configured Upcoming Birthdays and mapped Birth Date property as described in this article Upcoming Birthdays Configuration for SharePoint Online
Step 1: Select a ShortPoint element in ShortPoint Page Builder
You can for example select Events element or any other element you wish to display upcoming birthdays in.
Step 1: Connect ShortPoint
Select connection type
Select REST API in connection type list
Set connection parameters
1. REST API URL
Copy the following URL, replace UserLocation with the name of the manages property to which the user property you wish to display is mapped to.
Change the maximum number of upcoming birthdays to be retrieved by setting changing 50 after &rowlimit (For example rowlimit=5 to limit upcoming birthdays to be displayed to 5)
/_api/search/query?querytext=%27*%27&selectproperties=%27AccountName,UserProfile_GUID,LastModifiedTime,OriginalPath,Path,PreferredName,ServiceApplicationID,WorkEmail,PictureURL,SipAddress,RefinableDate18,UserLocation%27&trimduplicates=true&sourceid=%27B09A7990-05EA-4AF9-81EF-EDFAB16C4E31%27&clienttype=%27ObjectModel%27&rowlimit=50&sortlist='RefinableDate18:ascending'
Paste the URL in the REST API URL text box.
1. Set Advanced Settings
var days = 7; var startDate = new Date(); startDate.setHours(0, 0, 0, 0); startDate.setYear(2000); var toDate = new Date(); toDate.setDate(toDate.getDate() + days); toDate.setHours(0, 0, 0, 0); toDate.setYear(2000); function formatDate(date) { var d = new Date(date), month = '' + (d.getMonth() + 1),day = '' + d.getDate(),year = d.getFullYear(); if (month.length < 2) month = '0' + month; if (day.length < 2) day = '0' + day; return [year, month, day].join('-'); } parameters += "&refinementfilters='and(RefinableDate18:range("+formatDate(startDate)+",max,from=\"ge\"),RefinableDate18:range(min,"+formatDate(toDate)+",to=\"le\"))'"; return parameters;
Change the number of upcoming days for which birthdays are shown:
- To show today's upcoming birthdays change var days = 7; to var days = 0;
- Change var days = 7; to var days = 30; to show this month's upcoming birthdays.
Enable advanced settings and paste previous script under Change Parameters
Click Connect.
You can now see the custom property on the Content tab