Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW

How to get started with Microsoft Teams in Qlik Application Automation

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
MarkGeurtsen
Support
Support

How to get started with Microsoft Teams in Qlik Application Automation

Last Update:

Apr 25, 2023 10:03:29 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 22, 2021 9:23:33 AM

Qlik Application Automation includes a connector block for Microsoft Teams. This article provides you with the information needed to get started with it.

Content:

 

Authentication and Authorization

The Microsoft Teams connector in Qlik Application Automation is making use of oAuth to ask users to give Qlik Application Automation access to Microsoft Teams. When creating your data source, you will be prompted with a screen whether you want default permissions or admin permissions. The difference is the scopes that are requested by Qlik Application Automation.

Default permissions request the following scopes:

  • User.Read
  • profile
  • openid
  • Team.ReadBasic.All
  • email
  • offline_access
  • ChatMessage.Send
  • ChatMessage.Read
  • ChannelMessage.Send
  • ChannelMessage.Edit
  • ChannelMessage.Delete
  • Channel.ReadBasic.All

In a default setup of an Office 365 tenant, regular users can make use of all of these scopes. If you cannot log in using the default permissions you will have to contact your Office 365 admin regarding the use of this connector.

When selecting the admin permissions, the following scopes will also be requested and these will require admin consent to be used:

  • ChannelMessage.Read.All
  • Group.ReadWrite.All
  • Channel.Delete.All

Some blocks inside Qlik Application Automation require these admin permissions when being used. For example the blocks "List All Teams" and "Delete Team Channel". In the description of certain blocks it will tell you that you require admin permissions before being used.

 

Sending messages from Teams

The following blocks can be used to send a Message to a MS Teams channel:

  • Send Message
  • Send Html message
  • Send Html Message With Base64 Image
  • Send Structured Message With Base64 Images

For an example on how to send messages in Microsoft Teams, see How to send chat messages using the Microsoft Teams connector.

 

Sending messages

In the block Send Message, you can optionally add one or more attachments. Attachments are typically Cards, see below for more information.


Sending HTML messages

The following commands can be used to sent HTML messages to a MS Teams channel.

Block Send Html Message With Base64 Image

This block allows the user to send a message with HTML content and one base64 image. You can optionally add HTML code before and/or after the image. It's possible to encapsulate the image in HTML elements by opening an HTML tag in the Html Before Image input and closing the tag in the Html After Image input.

Block Send Structured Message With Base64 Images

This block allows the user to add one title, two paragraphs of text, two base64 images and two buttons with an action URL. You can choose which content items to use and you can define the order of these items in the message.

Sending Cards

Cards can contain text, images and buttons. They are added as Attachments to a message. 
The block Send Message can be used to send Cards to an MS Teams channel. The Card needs to be created with one of the following blocks:

  • Create Attachment Hero Card
  • Create Attachment Thumbnail Card
  • Create Attachment Adaptive Card

The output of the Snippet block needs to be mapped to the Attachment field of the Send Message block.
The Attachment also needs to be added as an HTML tag inside the Content.

Example:

<attachmentid="{$.CreateAttachmentHeroCard.id}"></attachment>

If you omit this HTML tag, it will be automatically appended by Qlik Application Automation at the end of your Content.

You can also add multiple attachments in one message, by creating a variable of type list (e.g. myAttachments), adding individual Attachments to this list and using the list variable in the Attachment field of the block Send Message.

Snippet block Create Attachment Adaptive Card

This block accepts a raw JSON representation of the Card as input. An interactive interface to generate the correct JSON of the Card can be found here: Card JSON

Note: it's possible to include base64 strings of small images as value for the url parameter. Keep in mind that MS Teams will not throw an error if the base64 string is too large, it will simply create a Card without the image. To create cards with large images, a public URL to the image should be used.

 

How to send images to MS Teams

Images with a public URL
You can use an HTML img tag with a public URL to the image in the following blocks:

  • Send Message
  • Send HTML Message

 

Example:

<img src="https://picsum.photos/200.jpg">

You can use an image with a public URL in Cards using following blocks:

  • Block Send Message + Snippet Create Attachment Hero Card
  • Block Send Message + Snippet Create Attachment Thumbnail Card
  • Block Send Message + Snippet Create Attachment Adaptive Card

Images with a non-public URL

If your image has a non-public URL, you can store it on cloud storage first (e.g Dropbox or S3), retrieve a public (shareable) URL from the cloud storage provided, and use that public URL in MS Teams.

Base64 images

With Base64 images we always recommend obtaining them from an external source and reference the variable in which the base64 string is stored, rather than attempting to paste a base64 string in an input field. This due to performance reasons.
You can send an image as a base64 encoded string using following blocks:

  • Send Html Message With Base64 Image
  • Send Structured Message With Base64 Images
  • Block Send Message + Snippet Create Attachment Adaptive Card

MS Teams Cards (see above) only support very small base64 images, e.g. icons. To send large images in base64 format, use one of the following blocks which use HTML to render the message:

  • Send Html Message With Base64 Image
  • Send Structured Message With Base64 Images

 

The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.

Labels (1)
Version history
Last update:
‎2023-04-25 10:03 AM
Updated by: