Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

How to send a file to a channel in Slack in Qlik Application Automation

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Emile_Koslowski
Employee
Employee

How to send a file to a channel in Slack in Qlik Application Automation

Last Update:

Nov 12, 2021 8:56:29 AM

Updated By:

Emile_Koslowski

Created date:

Sep 6, 2021 9:01:06 AM

Attachments

This article explains how Qlik Application Automation can be used to send files to a channel in Slack.

See this article for a basic introduction to sending messages to a channel in Slack 

Before you can send a file to a channel, the app needs to be invited to the channel.
To add our app to a channel:

  1. Go to the channel and type /invite
  2. Click "Add apps to this channel"
  3. Search for "Qlik Application Automation"* and add it to the channel

Sending text-based files

Use the block "Send Text Based File" from the Slack connector.

The following steps explain how to send a text-based file:

  1. Specify the channel to which you want to send the file. For more information about channel selection see: How to send a message to a channel in Slack 
  2. In the "Title" field, enter a title for your file. Include the file extension if applicable (eg. ".php" for PHP files).
  3. Enter the file's plain-text content in the "Content" field.
  4. Optionally, select a file type from the "File Type" dropdown. Various text file formats like Markdown, JSON, PHP, or "Slack post" are supported. The default file type is "Slack Post". 

JSON file example:

Emile_Koslowski_0-1625838490960.png

Result JSON file:

Emile_Koslowski_1-1625838551936.png

Because Slack has its own markup language & rules, using Markdown can be confusing. See this site for more information about Markdown support in Slack.

Sending binary files

Use the block "Send Binary File" from the Slack connector.

The following steps explain how to send a binary file:

  1. Specify the channel to which you want to send the file. For more information about channel selection see: How to send a message to a channel in Slack 
  2. In the "Filename" field, enter a name for your file. Include the file extension (eg. ".png" for PNG files).
  3. Enter the files base64 encoded content in the corresponding field. If no base64 encoded string of your file's content is available, try to use the formula "Base64 encode". Formulas in placeholders 
  4. Specify the file's content type in the "Contenttype" field. (eg. image/png or application/pdf). Available file types
  5. Optionally, you can write a message to introduce your file. This message will be prepended 

Example with a PNG file:

Emile_Koslowski_2-1625840601152.png

Result:

Emile_Koslowski_3-1625840652068.png

 

Advanced tip for binary files:

Instead of hard coding the file content, use a connector that has an endpoint that returns a base64 encoded string of a file. For example the "Get File Contents As Base64" from the Dropbox connector.

Tags (1)
Labels (2)
Contributors
Version history
Last update:
‎2021-11-12 08:56 AM
Updated by: