In my last newsletter, I shared with you a few resources to help you get started building apps for Microsoft 365. If you work with an organization that uses Microsoft 365 for work, you've got a great opportunity to use your developer skills and bring data and insights stored on Microsoft 365 into your work apps.
Recently I've been working on another app that shows how you'd find meeting times and schedule a meeting for you and other people in your organization. This is a common scenario for work apps, and while it's available in Outlook, having it directly in the work app helps your colleagues stay in the flow of work.
📺 Here's also a recording from a recent community call where I showed the app in action.
👾 And if you're interested in digging into it some more, here's the code.
Remember, the best way to check the app out, is to see it running. Follow the setup steps in the readme and run it on your tenant.
I've got some more ideas for new demos that I'll be working on in the coming weeks, so stay tuned for more updates. Meanwhile, if you've got any questions, don't hesitate to reach out by leaving a comment.
Many work apps need the ability to schedule a meeting with others in their organization. Here's how to do it for apps connected to Microsoft 365.
Work apps need work data
Work apps serve a specific purpose: they help you track projects, follow orders or manage resources. But rarely do they contain all the information that users need to complete their work. Typically, information about people, their calendars, or communication is stored elsewhere, like in Microsoft 365. And that's a shame because completing a task requires users to switch between different apps, which is detrimental to their productivity. Unless of course, you bring work data into your work app.
Find a meeting time and schedule a meeting on Microsoft 365
A common scenario for work apps is to schedule a meeting with others in the organization. While it sounds trivial, the app must be able to access attendees' calendars, find a suitable meeting time and schedule the meeting. And that's where Microsoft Graph comes in.
The app shows you how to make the best use of features available in the Microsoft Graph Toolkit and Microsoft Graph to build a UI that you could integrate with another app.
Check it out, and I'm looking forward to hearing what you think!
Recently, I showed you how you can build in under 10 minutes a simple personal assistant that shows users meetings they have left for the day. Here's an even easier way to do it using the Microsoft Graph Toolkit.
Show upcoming meetings for a Microsoft 365 user
Showing upcoming meetings is a common scenario when integrating Microsoft 365 in work applications. Using Microsoft Graph, your app can connect to Microsoft 365 and access a user's calendar. By building a specific query, you can retrieve meetings between now and the end of the day.
Recently, I walked you step by step how to complete this scenario in under 10 minutes using the Microsoft Graph JavaScript SDK. But there's an even easier way to do it using the Microsoft Graph Toolkit.
The easiest way to connect to Microsoft 365
Microsoft Graph Toolkit (MGT) is a set of components and authentication providers connected to Microsoft 365. MGT takes away the complexity of implementing authentication, loading data from Microsoft Graph, and showing it in your app. And if anything goes wrong, it also properly handles exceptions. Microsoft Graph Toolkit's components are highly customizable so that you adjust them to your app.
A quick comparison: signing in to your app
To understand the benefits of using Microsoft Graph Toolkit, let's have a look at an example: let users sign in to your app using their Microsoft 365 account.
Typically, you'd need code similar to the following:
See the difference? And we didn't even get to the good part yet: calling Microsoft Graph!
With Microsoft Graph Toolkit you can focus on building your app and solving problems for your customers. Microsoft Graph Toolkit takes care of the rest.
Show upcoming meetings with Microsoft Graph Toolkit
The best way to check out the app is to run the app locally by following the instructions in the README.
Because retrieving the data using MGT is so simple, I added some extra UI to differentiate between the different states of the app.
The MGT Agenda component, which I use to show the upcoming meetings offers different templates to customize the UI. When loading the data, I show a simple text message:
<mgt-agenda><templatedata-type="loading"><divclass="loading">Loading...</div></template><!-- trimmed for brevity --></mgt-agenda>
When there's no data to show, I take into account the fact that there might be no data because the user hasn't signed in to the app yet, or that the user might have no upcoming meetings:
<mgt-agenda><templatedata-type="loading"><divclass="loading">Loading...</div></template><templatedata-type="no-data"><divclass="no-data"data-if="mgt.Providers.globalProvider.state === mgt.ProviderState.SignedIn"><!-- No upcoming meetings --></div><divclass="no-data"data-else><p>Sign in to view your upcoming meetings</p></div></template></mgt-agenda>
To show upcoming meetings, for simplicity, I use the default template provided with the Agenda component.
Summary
Microsoft Graph Toolkit is a great way to build apps that connect to Microsoft 365. It takes away the complexity of connecting to Microsoft 365 and provides a set of components that you can use to build your app and bring in the data and insights from Microsoft 365. Because MGT components are highly customizable, you can seamlessly integrate them in your app.
Run the sample app locally and see for yourself how easy it is to build apps that connect to Microsoft 365 using Microsoft Graph Toolkit.