Skip to main content
Announcements
Get Ready. A New Qlik Learning Experience is Coming February 17! LEARN MORE

How to send a chart image to Slack, Microsoft Teams or email using Qlik Application Automation

100% helpful (3/3)
cancel
Showing results for 
Search instead for 
Did you mean: 
AfeefaTk
Support
Support

How to send a chart image to Slack, Microsoft Teams or email using Qlik Application Automation

Last Update:

Nov 7, 2024 8:11:03 AM

Updated By:

Sonja_Bauernfeind

Created date:

Sep 30, 2024 10:25:40 AM

Attachments

With the new inclusion of the Get Chart Image block in the Qlik Reporting connector in Qlik Application Automation, you now have more options to notify a group of users with more in-depth data and charts using Slack, Microsoft Teams, and email.

This article will guide you in sending your first chart image to Slack with Qlik Application Automation.

It explains a basic example of a template configured in Qlik Application Automation for this scenario.

You can make use of the template which is available in the template picker. You can find it by navigating to Add new -> New automation -> Search templates and searching for 'Send a Chart Image to Slack' or 'Embed a chart image in an email' in the search bar, and clicking the Use template option.

For guidance on sending charts via Microsoft Teams and mail, go to the "Next Steps" section at the end of this article.

You can download examples of the automations from this article: Send-chart-image-to-slack.json, Send-chart-image-to-outlook.json, Send-chart-image-to-mail.json, Send-chart-image-to-microsoft-teams.json

 

Full Automation

send application chart to slack in Qlik Application Automation.png

 

Configure the Automation

  1. Open the automation editor and search for the Qlik Cloud Services connector on the left-hand menu.

  2. Drag the blocks “Select Field Value” and “Create Bookmark” to the canvas and fill in the required inputs. You can add multiple Select Field Value blocks to apply selections to various fields. The Create Bookmark block is then used to create a temporary bookmark that can pass the selections to the Get Chart Image block.


    select field value.png

    create bookmark.png

    Warning: Whenever the “Get Chart Image” block is to be used, we advise you to only use it with temporary bookmarks or pre-existing persistent bookmarks.
  1. Search for the Qlik Reporting connector on the left-side menu, then drag the "Get Chart Image" block to the editor and attach it below the previous block.

    Choose the same app you chose when creating the temporary bookmark and use the ID value received from the “Create Bookmark” block. 

    Get Chart Image.png

    The height and width inputs are not required and default to 1000 if the fields are empty.

    Manually insert the Object ID input; it can not yet be retrieved through an API call.

    To find the chart ID from the app, open the app, then click Edit Sheet, right-click the chart, and open the Share/Embed menu from the menu dropdown that appears. You will see the object ID of the chart under the chart preview section as shown below:

    object ID.png

     

  2. Add the 'Condition' block to check whether the "Get Chart Image" block has returned a successful response.

    Condition Inputs.png

    1. If the condition block outcome evaluates to true:

      • Search for Slack connector from the left-side menu, add the "Upload File To Channel" block, and fill in all the required inputs.

        upload file to channel inputs.png

      • The chart image gets posted on the Slack channel as shown below:

        chart displayed in slack channel.png
         
    2.  If the condition block outcome evaluates to false:

      • Add the "Update Run Title" block to specify that the "Get Chart Image" block failed due to an error.

        update run title.png

      • Add an "Error" block to throw an error message from the "Get Chart Image" block and set the current automation run to be in a failed state.

        error inputs.png

 

Configure and send the Output

Embed the chart in the email

Gmail does not support embedding base64 encoded images due to security constraints. To work around this, we advise sending the chart image as an attachment through the Send Mail block in the Mail connector if you use a Gmail account.

See Gmail blocking small embedded inline images in email template for details on the restriction. 
  1. To embed the image in an email, you'll need to replace the Slack block with Send Mail block from the Microsoft Outlook 365 connector or the Send Mail block from the Mail connector and configure the block's Type parameter to HTML.
  2. In the body of the HTML, start adding a <img> tag and set the src parameter of the img tag to "data&colon;image/png;base64,".


    Content Body img tag.png

  3. Add the Get Chart Image block output at the end of the src parameter.


    Content Body get chart image.png

  4. Click the Get Chart Image label in the input parameter, and pick the Add formula option; then search for the "base64 encode" formula to apply it to the output from the Get Chart Image block.

    Content Body get chart image add formula.png

    add base64.png


    add base64encode in content body.png

  5. Finalize the img tag with an optional width and height to style the image.

    add width and height.png

 

Send the chart to a channel in Microsoft Teams

  1. To send the image to Microsoft Teams, replace the Slack block with the Send Html Message With Base 64 Image block from the Microsoft Teams connector.
  2. Configure the "Base 64" parameter of the block by mapping it to the output of the Get Chart Image block.


    get chart image base 64.png

  3. Click the field mapping for the Get Chart Image again and open the formula picker. Search for the base64 encode formula and apply it.

    add formula base64encode get chart image.png

    base64encode get chart image.png
     
  4. Set the Image Content Type parameter to image/png and (optionally) provide additional HTML content that will be inserted before or after the image.


    provide additional htlm content.png

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

 

Environment

Related Content

Labels (2)
Comments
arychener
Partner - Contributor III
Partner - Contributor III

Hi!
Great, thanks for sharing.
I'm having a problem with the "Send mail" block in the "Mail" connector: the image doesn't appear (blank square) in the email. Whereas the same automation/image does appear in Slack.
Is anyone experiencing the same problem?

AfeefaTk
Support
Support

@arychener 

I have observed the blank image in the email while testing since it appeared to be blocked content.

Could you please verify if that's the case, and whether you can see an option to Show Blocked Content in the email?

Please let us know your feedback.

Thanks!!

AneeshKanakdande
Partner - Contributor III
Partner - Contributor III

@AfeefaTk Unfortunately I have been facing the same issue since the release, it does not indicate to show Blocked Content, please see the image for a reference output, that's all I see.

AneeshKanakdande_0-1730134778212.png

 

AfeefaTk
Support
Support

@AneeshKanakdande Which mail server is it?

Are you opening mail in the browser or any mailbox app?

If it's in the browser, could you please try opening it in the corresponding mailbox app and check if that makes any difference?

If that still doesn't work, please share the automation workspace and run log to further troubleshoot the issue.

You can find steps on how to achieve above asked details here.

Thanks

AneeshKanakdande
Partner - Contributor III
Partner - Contributor III

@AfeefaTk Thanks for suggesting the solution(s), it does work when I open in the mailbox app, I was using the office365 mail server and sending to a gmail address. Does this mean, it would not work if I have to send emails to addresses on a different mail server (like I was trying)?

 

Thanks in advance!

PabloLabbeImaps
Partner Ambassador
Partner Ambassador

Gmail web client blocks this kind of content per security rules for the service. 

There are some workarounds but it requires custom parameters in the email body,  but the email component of Qlik Automation does not allow any kind of customization in the request body or parameters.

AneeshKanakdande
Partner - Contributor III
Partner - Contributor III

@PabloLabbeImaps Understood, thanks for the response! 

Charly_
Contributor II
Contributor II

Hello,

I have the same problem, sending images works well on an Outlook client, but does not work on Gmail (I send to an account on the same workspace as the account used in the qlik senders email module).

I noticed in the source code of the mail that the mail is not encoded in base64 but in "quoted-printable" and that Gmail has added escape characters after each "="
Example: <img src=3D"data
(3D is an escape character)

Any idea why Gmail adds this and not an Outlook client?

Thanks for your help

AfeefaTk
Support
Support

@Charly_ 

Gmail does not support embedding base64 encoded images due to security constraints. To work around this, we advise sending the chart image as an attachment through the Send Mail block in the Mail connector if you use a Gmail account.

See Gmail blocking small embedded inline images in email template for details on the restriction. 

We have now added it as a Disclaimer to this article.

Thanks

sergeyko
Partner - Creator
Partner - Creator

Sharing my related question where we are discussing other options for embedding charts into emails to make it work in email clients such as Outlook.

https://community.qlik.com/t5/Qlik-Application-Automation/Distribute-charts-over-email-as-embedded-i...

@Emile_Koslowski - Tagging you here as well for better reach. Let us know if you have any feedback on the proposed change for generating multiple images with unique file names as part of the same automation.

Version history
Last update:
‎2024-11-07 08:11 AM
Updated by: