Hi there,

I’m Kusaka and I often write blogs about system cooperation.

A customer asked us about how Microsoft365/Office365 works with the Outlook calendar. Continuing from the previous article, I will explain how to use Microsoft Power Automate.

Table of Contents
11: Background to Outlook and Questetra Connectivity Analysis
2: Settings to trigger Questetra from your Outlook schedule
 2.1: Settings to trigger from Microsoft Power Automate
2.2: Settings for linking Outlook and Questetra
  2.2.1: OAuth settings on the Outlook (Microsoft 365/Office 365) side
  2.2.2: OAuth setting on the Questetra side
  2.2.3: Settings to trigger by Questetra timer
3: Summary

1: Background to Outlook and Questetra Connectivity Analysis

The two most common cases of integration with calendar services, not just Outlook appointments, are as follows

  • Register an appointment in a calendar during business flow processing
  • Start the business flow (process) in conjunction with an event registered in the calendar

The previous article described the former case, but this time I will explain the details of how to achieve the latter.

Related article: Google Calendar: Insert Event *Prepared as a component for data integration (add-on XML)
      How to start a workflow from an appointment on Google Calendar

2: Settings to trigger Questetra from your Outlook schedule

This time, we will start the business flow when the title of the event registered in the calendar contains a specific character string.
Example: If the character string “Web meeting:” is included, the meeting report business flow is automatically started.

There are two possible ways to trigger the process: using Microsoft Power Automate and using the timer in Questetra. In the former method, a workflow is started just before an appointment is registered in Outlook. On the other hand, in the latter method, the workflow for that day is started after midnight. So the content is slightly different.
In addition, prepare a reception point using a [Message Start Event (HTTP)] in the business flow to be invoked, so that it will be started by receiving an HTTP request.
Related manual: M221: Auto Start Triggered by HTTP Request

Also, please note that this method using Power Automate requires components that are only available with a PREMIUM contract.

2.1: Settings to trigger from Microsoft Power Automate

As shown in the figure below, when the scheduled date and time registered in Outlook approaches, triggering can be achieved by detecting whether the subject contains a specified character string and sending an HTTP request to start the Questetra operation.
* Please note that the component that sends HTTP requests can only be used with a Power Automate PREMIUM subscription.

2.2: Settings for linking Outlook and Questetra

We have a previous article on integration with Microsoft 365/Office 365, not just Outlook. Please refer to that.
Related article: How to Cooperate between Office 365 and Cloud-based Workflows
As I wrote in this article, when using an Authorization Code with AzureAD v2.0 endpoint, the Questetra side can only handle it by configuring OAuth2. This time I was able to achieve it in the same way.

2.2.1: OAuth settings on the Outlook (Microsoft 365 / Office 365) side

Please refer to the following articles to obtain the Client ID and Client Secret.
 Application Registration Procedure in Office 365 for Linking Office 365 and Questetra Cloud Workflow with API

2.2.2: OAuth settings on the Questetra side

Same as “2.2: OAuth settings on the Questetra side” in the following article, please refer to that for configuration instructions.
However, the Scope should be ”https://graph.microsoft.com/calendars.read offline_access”.
* In the previous article, readwrite was required to register the appointment, but this time it’s just for reference so it’s fine to use read.
How to Output Files from Cloud-based Workflow Questetra to OneDrive

2.2.3: Settings to trigger by Questetra timer

Set a timer to start up on a daily basis after midnight and send an HTTP request to the Outlook API to get the data from the calendar. Prepare a workflow application that processes the results in a script.
The flow diagram is as follows.

Sending an HTTP request to the API can be achieved by using the [Throwing Message Intermediate Event (HTTP)].
Related manual:M225: Auto Sending of HTTP Requests with Business Data Inserted

  • Communication settings
    • HTTP Method: GET
    • Data Item to save the response: Specify the String-type Data Item. The JSON obtained is stored here, so it is processed with the [Script Task].
    • Data Items for storing errors: Although not required, it’s better to specify these Data Items so you can check the details of the error. Furthermore, it is better to set up a flow in case of error following this event that is determined if an error occurred or not by referring to this Data Item.
  • Header
    • Authorization header: Select OAuth 2.0
    • OAuth2 setting: Specify the name set in 2.2
  • Send parameters
    • Prepare two, startDateTime and endDateTime, and specify the target range as, for example, 2020-09-15T 00:00:00 and 2020-09-15T 23:59:59. If you specify the entire day, the initial value of the String-type data is automatically generated from the start date. The initial value expression can be specified as follows
       For startDateTime; {#format(processInstanceStartDatetime, ‘yyyy-MM-dd’)}T00:00:00
       For endDateTime; {#format(processInstanceStartDatetime, ‘yyyy-MM-dd’)}T23:59:59

As a result of API execution, the following JSON data can be obtained. A [Script Task] is used as a way to process JSON.
I will omit the details of script processing, but if there is an event that includes “Web meeting:” in the subject, you can achieve this by configuring your workflow to start a process for it. The subject line is encoded, so prepare your logic with this in mind.
Related manual:M230: Auto Executing Complex Data Processing (ECMA script)
* Click here for details on the JSON format that can be obtained.
See Microsoft Graph / v1.0 / Calendar / Events / event Resource Types

{"@odata.context": (omited)
 "value":
  [
    {"@odata.etag": (omited)
     "subject":"Web・・・(Encoded state)",
      (omited)
     "start":{"dateTime":"2020-08-31T02:00:00.0000000","timeZone":"UTC"},
     "end":{"dateTime":"2020-08-31T03:00:00.0000000","timeZone":"UTC"},
      (omited)
    },
    { (For the next event・・・) }
  ]
}

3: Summary

Continuing from the previous article, I’ve summarized how Outlook works with your calendar.
The integration with the calendar is a great way to automate tasks, so please take advantage of it.

If you have any questions please feel free to contact us here.

Reference document
List Microsoft Graph / v1.0 / Users / Calendar / Events

%d bloggers like this: