Skip to main content Skip to complementary content

Microsoft 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

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.

The Inputs tab of a Send Html Message With Image block.

The Inputs tab of a Send Html Message With Image block. The Html Before Image block contains Html tags to be attached to the image.

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. More information about the different types of cards can be found here: Cards

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 Snippet 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:

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

If you omit this HTML tag, it will be automatically appended by Qlik Application Automation for OEM 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 Snippet 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

There are three methods 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 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

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

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!