FileMaker tips, techniques, and news.

By Gayoung Moon  Posted on  December 17th, 2018  in  FileMaker, Free Downloads

FileMaker Outlook Calendar Integration

Outlook and Microsoft Office are one of the most popular business software packages and services on the planet, with Outlook.com alone boasting over 400 million users in 2018. And with the Microsoft Graph API, integrating with Outlook and its calendar has never been easier. In this article we will walk through how to use the Microsoft Graph API to automatically create events in Outlook Calendar using FileMaker, streamlining event and scheduling management in your FileMaker solution by eliminating double data entry.

What You Need

You must have Office 365 to use this article's integration, as the Microsoft Graph API does not support Outlook hosted on Exchange Server. Also make sure you have admin access to your Office 365 subscription if you have a business or school user account.

Creating a Microsoft Graph Application

Make sure you create Azure AD Tenant first if you are using a personal account and not work school account. Similar to other API integrations, you need to create an app first. Go to the application registration portal and add an app (Note: the video shows old application registration page. New process will have you start from Azure portal as of May 1st, 2019). Click New Registration, give it any name, and select account type depending on who will be connecting to this application.

microsoft-outlook-azure-setupmicrosoft-outlook-create-application

Then click on Certificates & secrets tab and create new client secret. Don't have expiration date unless there's specific reason to do so.

microsoft-outlook-create-secret

Managing App Permissions

Microsoft Graph requires that each user give the app permissions to be able to push and pull data to and from their Outlook Calendar. Before users can give permissions, you need to set up the default permissions on the application registration page. There are two types of Microsoft Graph permissions: delegated permissions and application permissions. For purpose of this article, we will be using delegated permissions to talk to Outlook Calendar as a user instead of as an application.

For this Outlook Calendar Integration you will need to add the following delegated permissions:

  • Calendars.ReadWrite
  • Calendars.ReadWrite.Shared
  • User.Read

Microsoft Graph API Permission

Authenticating with Microsoft Graph

Once you have your API information, you will need to authenticate your solution with the Microsoft Graph API to connect to Outlook Calendar. The sample file at the end of the article has the calls & web viewers that you can reference to set up initial authentication between Outlook and your new Graph application.

When the user clicks Connect button, they will be asked to log in to their Outlook account and approve delegated permissions for the application.

After the user logs in, a FileMaker script parses the redirected page's URL for the client ID and auth codes that will be used for requests to Outlook.

Microsoft Permission Screen

Making Requests and Parsing the Response

Microsoft Graph API supports multiple types of requests such as HTTP POST, GET and DELETE. You can perform all actions by using native the Insert from URL[] script step and giving it a valid URL and cURL options including required fields within the JSON body specified by the documentation.

Here's a sample request body to create a calendar event. Note how the DateTime element is formatted. For more details, refer to Microsoft Graph's properties under the event page.

{
    "End" : 
    {
        "DateTime" : "2018-12-12T11:00:00",
        "TimeZone" : "Eastern Standard Time"
    },
    "Start" : 
    {
        "DateTime" : "2018-12-12T10:00:00",
        "TimeZone" : "Eastern Standard Time"
    },
    "Subject" : "Test 123"
}

If you make a successful request, the API will return a JSON-encoded body. You can check if you encountered any errors by looking at the following function after the Insert from URL[ ] step:

Get ( LastExternalErrorDetail )

This function will return 200 on success; otherwise the API encountered an error. If your call was successful, you'll get response a JSON-encoded response body like below with event ID and change key that you will need to use when updating events:

{
    "@odata.context" : "https://graph.microsoft.com/v1.0/$metadata#users('gmoon%40dbservices.com')/calendar/events/$entity",
    "@odata.etag" : "W/\"eyoqZr4V6UOE23scd9kKdQABYJFSxw==\"",
    "attendees" : [],
    "body" : 
    {
        "content" : "",
        "contentType" : "text"
    },
    "bodyPreview" : "",
    "categories" : [],
    "changeKey" : "eyoqZr4V6UOE23scd9kKdQABYJFSxw==",
    "createdDateTime" : "2018-12-11T18:26:21.48905Z",
    "end" : 
    {
        "dateTime" : "2018-12-12T17:00:00.0000000",
        "timeZone" : "Eastern Standard Time"
    },
    "hasAttachments" : false,
    "iCalUId" : "040000008200E00074C5B7101A82E00800000000525905047F91D4010000000000000000100000002EF55A9CBBF9F8429AA5DF86AE8FB2CF",
    "id" : "AQMkADAwATM3ZmYAZS0wYTI1LWI1N2ItMDACLTAwCgBGAAADVUTIWkB8vk_xO5-ko1YImAcAeyoqAGa_FelDhNt7HHfZCnUAAAIBDQAAAHsqKgBmvhXpQ4Tbexx32Qp1AAFghoJ2AAAA",
    "importance" : "normal",
    "isAllDay" : false,
    "isCancelled" : false,
    "isOrganizer" : true,
    "isReminderOn" : true,
    "lastModifiedDateTime" : "2018-12-11T18:46:23.4155607Z",
    "location" : 
    {
        "address" : {},
        "coordinates" : {},
        "displayName" : "",
        "locationType" : "default",
        "uniqueIdType" : "unknown"
    },
    "locations" : [],
    "onlineMeetingUrl" : null,
    "organizer" : 
    {
        "emailAddress" : 
        {
            "address" : "example@outlook.com",
            "name" : "Gayoung Moon"
        }
    },
    "originalEndTimeZone" : "Eastern Standard Time",
    "originalStartTimeZone" : "Eastern Standard Time",
    "recurrence" : null,
    "reminderMinutesBeforeStart" : 15,
    "responseRequested" : true,
    "responseStatus" : 
    {
        "response" : "organizer",
        "time" : "0001-01-01T00:00:00Z"
    },
    "sensitivity" : "normal",
    "seriesMasterId" : null,
    "showAs" : "busy",
    "start" : 
    {
        "dateTime" : "2018-12-12T16:00:00.0000000",
        "timeZone" : "Eastern Standard Time"
    },
    "subject" : "4 PM Test",
    "type" : "singleInstance",
    "webLink" : "https://outlook.live.com/owa/?itemid=AQMkADAwATM3ZmYAZS0wYTI1LWI1N2ItMDACLTAwCgBGAAADVUTIWkB8vk%2BxO5%2Fko1YImAcAeyoqAGa%2BFelDhNt7HHfZCnUAAAIBDQAAAHsqKgBmvhXpQ4Tbexx32Qp1AAFghoJ2AAAA&exvsurl=1&path=/calendar/item"
}

Things to Think About

  • It's important to note that if you change permissions on the application registration page, users will have to reauthenticate and give the application those new permissions. Same thing needs to happen if you delete and regenerate your application password for whatever reason.
  • Some users won't have permission to allow application access to their Outlook calendar. Make sure your 365 administrator gives this to each of them before trying to sync calendar events.
  • If you want to display a personal calendar in FileMaker via a web viewer, users will need to log in each time that specific layout refreshes. We recommend that you use a public calendar that anyone can see to avoid the need to constantly relog in.
  • You will need to refresh your access token at least once every hour, as the token expires after 60 minutes. We recommend that you error trap for HTTP code 401 after a request, refresh the token if there's a 401, and then retry the original request.

Conclusion

The Microsoft Graph API can help streamline your event and scheduling workflow by giving you the ability to sync your Outlook calendar flawlessly with your FileMaker solution. Contact us if you need help integrating your FileMaker solution with your Outlook Calendar!

Did you know we are an authorized reseller for FileMaker Licensing?
Contact us to discuss upgrading your FileMaker software.

Download
Download the FileMaker Outlook Calendar Integration File
Please complete the form below to download your FREE FileMaker file.
FileMaker Experience *
Terms of Use *
OPT-IN: I agree that I am downloading a completely free FileMaker application file with no strings attached. This file is unlocked, and I may use it for my business or organization as I see fit. Because I am downloading a free file, I agree that I should receive occasional marketing. I understand that I can OPT-OUT of these emails at anytime.
Gayoung Moon thumbnail
Gayoung Moon

Gayoung is a certified FileMaker and web developer who takes pride in her work and is driven to provide exceptional solutions for clients. The combination of her friendly nature and willingness to go the extra mile sets her apart in her field of expertise.

FileMaker 18 Certified Developer
FileMaker 17 Certified Developer
FileMaker 16 Certified Developer
FileMaker 15 Certified Developer
FileMaker 14 Certified Developer
FileMaker 13 Certified Developer
FileMaker 12 Certified Developer
FileMaker 11 Certified Developer
"We were actually able to add more features than we thought would be possible within our budget. We always experienced a ‘can do’ attitude and DB Services was incredibly patient and easy to work with."
Courtney Hartman
Art Director
"The new FileMaker custom website interface is very user-friendly and easy to follow for our clients. In addition, it is much faster than the old Instant Web Publishing (IWP) interface. Thank you and all the others who have helped us out at DB Services. I am very grateful for the excellent service you provide us. Its nice to know we can call you for help if we have an issue."
Wayne Capek
President
"We needed a solution that would simplify the administration of our responsibilities under our contract with the State of Indiana. We have seen a dramatic increase across the state in the number of potential foster and adoptive parents that have begun the preparation and training process. This increase has resulted in a significant opportunity for children available for adoption. That’s a big win for everyone! And it’s all because we can refer potential parents to the proper state contacts efficiently and quickly."
Chris Morrison
Executive Director
"Thank you for all of your expertise and valuable help. I am so grateful to have found DB Services."
Linda Findlay
Owner
"Thank you for our new database system. We transitioned from a carbon copy paper based system to a digital database. The software has saved us time and money. We used to archive all our jobs in cabinets, now we can look up a job in seconds from anywhere. The software allows us to easily email estimates to our customers in pdf format. In a year there was a return on investment just from eliminating the purchasing of our carbon forms."
Todd Cartmel
Owner
"The new system allows us to create and track jobs for customers along with inventory, something we had been doing with separate word and spreadsheet files. Because it’s now so intuitive, new staff members are able to begin using the database immediately without our usual training session and ‘cheat sheets’ for getting around within the file."
Tom Andrews
President