Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Apr 25, 2023 10:03:29 AM
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:
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:
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:
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.
The following blocks can be used to send a Message to a MS Teams channel:
For an example on how to send messages in Microsoft Teams, see How to send chat messages using the Microsoft Teams connector.
In the block Send Message, you can optionally add one or more attachments. Attachments are typically Cards, see below for more information.
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:
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.
Images with a public URL
You can use an HTML img tag with a public URL to the image in the following blocks:
Example:
<img src="https://picsum.photos/200.jpg">
You can use an image with a public URL in Cards using following blocks:
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:
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:
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.