Introduction

With ONE DATA it is possible to fetch data from Microsoft Outlook and use it in your Workflows. This article will explain step by step how to do it, and will show in an example how to fetch the calendar events of a user. For this topic, it is helpful to have some basic knowledge about HTTP, JSON and about REST APIs for better understanding.

The data will be fetched from the Microsoft Graph Rest API, which gives a broad variety of information and actions that cannot be covered in this article. To see what is possible with the API, have a look at the official documentation.


Prerequisites

To be able to fetch data from Outlook with our Workflow, we need to configure a Connection and Credentials with the respective authentication type.


Credentials

First of all, we create new Credentials with the key type Microsoft ROPC (Resource Owner Password Credentials) and fill in the required information. To get all information that is necessary for that Credential type, you need to correctly register ONE DATA / your Workflow at Microsoft Azure.

An explanation on how that is done, can be found in the Credentials article.


Connection

The second prerequisite is a Connection for the Microsoft Graph API.

Navigate to the Connections menu and create a new one of type REST. The base URL we'll need is "https://graph.microsoft.com/v1.0/". You can also select the Credentials we created in the previous section, but that is not mandatory, as we can also choose them later in the Flexible REST API Processor.


Example Workflow

As mentioned in the introduction, our goal is to create a Workflow that retrieves the calendar events form the user who's Credentials we used in the previous section.

First of all, we add a Custom Input Table with a column named "endpoints" to which the endpoints from the MS Graph API we want to call are saved. In the example case this would be: "me/events?$select=subject,organizer,attendees,start,end,location"

Below is the configuration of the processor:


Then we need to configure our Flexible REST API Processor. First, our previously created Connection is added. The Credentials don't need to be set here, because the correct ones are already set in the Connection configuration.


Last but not least, we need to parse the response from the MS Graph API accordingly, to display the information in a nice format. For that a XML / JSON Parsing Processor is used, which extracts the information needed by the JSONPaths specified in the processor configuration and converts it to a table. It is also possible to inspect the whole JSON response in the "Results" tab of the processor.


Following JSONPaths are used to get the desired information:

value[*].subject

value[*].start.dateTime

value[*].organizer.emailAddress.name


To finish the Workflow, we add some Result Tables to view the raw response, error messages thrown by the Flexible REST API Processor and the final result. This is how the Workflow looks in the end (it is also attached at the bottom of the article):


And this is the final result (the organizer names were removed this picture):