How Landscape Institute integrated People with Outlook to share holiday information

by
February 28, 2018

How Landscape Institute integrated People with Outlook to share holiday information

Integrations allow you to combine your favourite pieces of software, which can help you to save time, effort, and sometimes some money. The aim of People HR integrations, is to boost your productivity.

One of our clients, Louis from Landscape Institute, shared his integration story with us. His story details how he used People’s API to synch holidays into, and out of, Outlook calendars.

Here is the story he shared with us.

Overview of our People-Outlook integration

I was asked by our chief executive to be able to show holidays in Outlook calendars.  While this is possible using the downloadable calendar on People HR, it wasn’t an automated process with the control that our SEO wanted.

I set about using a combination of the People API, and an EWS-based integration with Office365, with the following functionality:

  • Loop through all People Holidays
  • If holiday is approved, check if the holiday exists in the following calendars
  • The Approver (The Manager)
  • The Requester (The Member of Staff)
  • A Shared Company Calendar
  • The HR Officers Calendar
  • Delete holidays from calendars which have been deleted from People
  • Assign each holiday a unique reference

The project is maintained at the following Github repo

https://github.com/landscapeInstitute/PeopleHR-Holiday-Office365-Sync

How we built the code

How we built the code

I decided to build the code in PowerShell, and run it as a service on one of our servers. The code should only need to run once every 24 hours.

The main code block loops through every employee, and then loops through all of their holidays. If the holiday is an approved holiday, it checks if it is present in the Outlook calendars.

Outlook calendars

The scripts run a process function, which in turn checks if the holiday is in Outlook, and if not, adds it.

Each holiday is assigned a unique MD5 string, using the holiday requester, the start date and the end date. This unique ID is then saved against Outlook’s iCALUID attribute, and can be searched in the future to see if the holiday has been added.

The Script adds the requester’s comments to the requester’s entry on Outlook, but not to the approver’s or any others.

Adding the ability to remove cancelled holidays from Outlook

Once the script has added all recently approved holidays, it can reverse the process, removing any holidays from Outlook which have been cancelled in People.

To do this, the script calls EWS for a list of calendar events which have an ICALUID present, and checks the body of the entry for “People Holiday Sync” to verify it was added by the script. If not present in People, it is deleted.

Ultimately, this ends up with the requester, in this case me, having this dropped into their calendar automatically

Outlook calendars

How we could make this integration even better

This was a relatively quick build, taking only a few hours to get the code working and then improving a few small pieces over the next few days as and when I could.

If I was to improve it further, I’d have the script call the API’s less times on every run, possibly caching all the data it needs at first run.

I would also maybe rebuild as a standalone application with a simple installation wizard so other people could use this easier and test that their EWS is working correctly.

There is another script that I run alongside this, which makes sure my People account, which does the adding / removing, has the correct permissions over everyone’s calendars.

At the moment I run this script manually if I create any new Office365 users, but I would look to use the office365 API to give an application this ability using azure, without needing admin credentials entered into the script when its run.

Thanks, Louis

A well-deserved thank you – and a great taste in t-shirts

To thank Louis for his story, we sent him two t-shirts, using his choice of designs.
The first t shirt read “Life in Code” (pictured below), and the second read “Wubba Lubba Dub Dub” – a reference for any Rick and Morty fans out there.If you’ve got a story you’d like to share with us, get in touch!

4

Or, if you’d like to build an integration yourself then visit this page for more information: https://www.peoplehr.com/partners/

Stay ahead with HR

Get free HR insights, expert tips and exclusive interviews, and start making more impact at work

Please enter a valid email address

See People HR in action

View our short video demo

Get started absolutely free

No credit card required

Talk with an expert to learn how People HR could help your organisation