Posting to Microsoft Teams from Workflow

Hi, there.


There are various tools of enterprise social networking, nowadays.

I have posted articles concerning linkage with Slack and with ChatWork previously. Today, I would like to describe regarding the linkage between Microsoft Teams, aiming for a combined use of Office 365 and Questetra.
 Related article: Check Digest of Business with Internal Chat Service “slack”
 Related article: Connecting ChatWork with Cloud Workflow


1. Overview of linkage between Microsoft Teams and Questetra
2. Settings on Microsoft Teams
3. Settings on Questetra
3-1. The case of using Add-on
3-2. The case of not using Add-on
4. Closing


1. Overview of linkage between Microsoft Teams and Questetra

The flow of processing is like the following figure.
Although it is a common form for collaborations with enterprise social networking, that is when an approval request results via Questetra, the content of the result and the link to the details will be posted to Microsoft Teams.


2. Settings on Microsoft Teams

Configure “Incoming Webhook” for the connector for a post-destination channel.

Configure the name and the image, and obtain the endpoint URL. (Copy the endpoint URL somewhere for later use.)


3. Settings on Questetra

I will explain separately in two cases where using and not using “Add-on (Service Task definition)”.
An Add-on is a file that can be imported and used, and “Add-on (Service Task definition)” is a piece that can be embedded in a flow. I recommend using an Add-on if you prefer easier setup. Whereas, if you want to handle it more highly such as expanding the form of posting etc, you can flexibly deal with better not using Add-ons.


3-1. The case of using Add-on

First, import the Add-on (Service Task definition).

Download the Add-on file below and import it to Questetra App in reference to this page (M415).


Config items are as the following.

Config name Required Type
A: Endpoint URL Required Enter the endpoint URL obtained earlier
B: Select TEXT DATA for Title Optional Select a String type Data Item (single line) that is storing the title you want to post
C: Select TEXT DATA for Text Required Select a String type Data Item (multiple
lines) that is storing the text you want to post
X: Select TEXT DATA for Log Optional Specify a String type Data Item to store log output if needed

* If you set up the following in the text field of Data Item as the initial value, the wording to be posted will be prepared automatically.
(Substitute the part “” with the value of your own environment. You can not use the “${var[applicationRoot]}” format which I will mention later.)

Your request has been approved. [Details]{processInstanceId}
Otherwise, there is another method using “Service Task (Data assignment)” before the Add-on.。
  Related document: M227: Auto Executing Data Binding, Arithmetic Operations

* This Add-on is configured to send a JSON data toward Microsoft Teams according to the format that I will explain later, and the contents to be posted is very simple. Even so, it is also possible to send more advanced contents by expanding the Add-on.


3-2. The case of not using Add-on

The part of sending posts in the flow is as the following.

At the “Service Task (Data assignment)” on the left, the JSON data to post to Microsoft Teams is prepared. Then it is sent to the endpoint URL as HTTP request at the “Throwing Message Intermediate Event (HTTP)” on the right.

In the “Service Task (Data assignment)” in which JSON data is to be prepared, set up as the following.

“title”: “Approval:#{processInstanceTitle}”,
“text”: “Your request has been approved. [Details](${var[applicationRoot]}OR/ProcessInstance/listView?processInstanceId=#{processInstanceId})”

With this setting, the wordings to be posted are;
as the subject “Approval:” + string set in “Title”
as the body, “Your request has been approved” + string of [Details] which is hyperlinked to the details page
Modify this part to what you want to actually post.

* See the following for the details of “Service Task (Data assignment”
 M227: Auto Executing Data Binding, Arithmetic Operations
“${var[applicationRoot]}” and “#{processInstanceId}” are formats for converting according to the environment or ID.

* See the following for the detailed specification of JSON data to be transmitted.
 Post an actionable message card to an Office 365 group
This page is the link destination of “Get started with actionable messages in Office 365” on the connector setting screen, and from the content, I presume that the specification for Outlook is applied to Microsoft Teams as it is. In addition, markdown notation is available in the posting text. More advanced posting is also possible by devising the setting in the “Service Task (Data assignment)”.

Also set up as the following in the “Throwing Message Intermediate Event (HTTP)” which is for sending HTTP request.

  • Network Settings tab -> Access URL: The endpoint URL which you have obtained earlier at setting Microsoft Teams
  • Network Settings tab -> HTTP Method: POST (Specify Request Body)
  • Request Body tab -> The Data Item to be sent as the request body: Data Item storing the JSON data which is prepared at “Service Task (Data )assignment)”
  • Request Body tab -> Content-Type of request body: “application/json
* See the following for the details of “Throwing Message Intermediate Event (HTTP)”
 M225: Auto Sending of HTTP Request with Business data Inserted


4. Closing

When you run it, it will be posted like the following.

Thus, you can insert a processing of posting to Microsoft Teams into a business flow only with easy settings.

If you have any question, please feel free to Contact us.


%d bloggers like this: