Microsoft Teams offers scheduling capabilities through the Shifts app built into the native Teams experience. The idea is to empower teams to create, update, and manage schedules for a tighter collaborative experience. This functionality is heavily used by first-line worker groups, especially on the clinical floor. With a rich API extensibility and tight coupling with other M365 products, Shifts offers a way to truly automate the schedule management process - eliminating paper trails and removing redundancies in communication.
Process owners often struggle with adding business logic to the process of scheduling. The following use-case illustrates how Shifts can be paired with a data model (maintained in a SharePoint List), and elevated with business logic (set up using Power Automate) to create a role/eligibility-based scheduling process.
Let’s envision a scenario where we are looking to automate a Covid volunteer scheduling process for a vaccination clinic. In this clinic we likely have volunteers who are filling multiple, unique roles. Each of these roles may have defined shifts that are available to be volunteered for. For a volunteer to sign up for a specific shift they must meet a defined set of qualifications.
Clinic Roles:
- Vaccinator
- Observer
- Runner
- Check-In Support
- Documenter
Now for a volunteer to register for a vaccinator shift at the clinic they might have to be a RN, LPN, MA DO, or have some other qualification that allows them to administer vaccines. On the other hand, someone volunteering for a Check-In Support shift would not have to meet any qualifications.
Storing the Data
The first step to automating this process is determining where we want to store our volunteer data. In this example, I will be using a SharePoint list; however, any tabular data structure would work well.
You can see the list stores basic information about the volunteer, including the UPN of the user (not pictured in screenshot), along with a prefix denoting their qualifications relevant to scheduling a shift.
Creating a Teams Shift Schedule
Before you can create a shifts schedule, you must create a Team! Once you have your team you can create a shifts schedule for that team by opening the Shifts app in Teams and creating a new team schedule.
Once you have your Teams Schedule and you have added all volunteers to the team, you can create a new group within your schedule. Each group in the teams Shift Schedule can have its own unique schedule, so we will create a group for our vaccination clinic.
Creating a schedule group
If you have only a few team members it is easy to create a schedule group and add the appropriate members through the Shifts app UI. However, if you have enough members (like in our volunteer example) it makes more sense to add members in a more automated fashion. To do this you can create a simple Power Automate that calls a Microsoft Graph API endpoint for creating a scheduling group.
A sample Power Automate is pictured below. You can see the flow loops through the volunteer data that is stored in the SharePoint list and creates an array of UPNs. The last step is calling the Microsoft Graph API endpoint to create the group with the array of users (documentation below).
Create schedulingGroup - Microsoft Graph v1.0 | Microsoft Docs
Creating Shifts
After you have run your Power Automate to add your users to the Shifts group, you are ready to create some shifts! Create shifts that can be claimed by volunteers by using the open shifts functionality and specifying how many open slots there are for each open shift. You can also add a custom label and color theming to differentiate between your shift types.
Once you have your open shifts created your team members will be able to sign up to volunteer!
Remember to share your changes with the team.
Automating Shift Approval
Once a volunteer signs up for a shift we need to make sure they are qualified for the shift. To automate this approval process again we will turn to Power Automate!
Your approval process will be specific to a set of requirements; however, in almost all cases the Power Automate will be triggered when the Open Shift request is created (a volunteer requests a shift) and will end with the Open Shift request being approved or rejected!
The beginning of my approval Power Automate for this volunteer example is pictured below. After you get some details about the open shift request, the type of shift, and validate the request was created (not deleted or updated), all you need to do is add your own business logic to validate the team member meets the requirements for the shift!
For more information on how to get started with power automate check out:
Get started with Power Automate - Power Automate | Microsoft Docs
And that’s all! Now you can use Shifts in Teams and Power Automate to quickly design a fully automated role-based scheduling solution!
*Please note that different connectors in Power Automate have different throttling limits. Keep this in mind when designing your approval solution.
Author:
Technical Architect
Microsoft Technology Center