Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: 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:

Oct 3, 2024 1:46:12 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' 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

  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

Labels (2)
Comments
PabloLabbeImaps
Partner Ambassador
Partner Ambassador

Great feature finally deployed. I'm trying to create an example but when a do the lookup do find the app in the get chart image block, it doesn't return the app I'm looking for.  The list is shorter compared with the do lookup in the previous blocks from Qlik Cloud Services.

AfeefaTk
Support
Support

@PabloLabbeImaps The lookup will only retrieve the first 100 apps, you can use the lookup search bar to do a new lookup by searching for apps by name.

Hope this helps!!

Thanks

 

PabloLabbeImaps
Partner Ambassador
Partner Ambassador

Yes, I'm using the lookup search bar and it doesn't show all the apps I'm searching by name.
When I do the search lookup in the "Create Bookmark" block it show me all app with the name "Iron".

When I do the search lookup in the "Get Chart Image" block it show me just 2 apps with the name "Iron", not all.

I've uploaded a gif video showing the behavior of the search lookup in these 2 different blocks.

lookup_search_get chart_image.gif

 

AfeefaTk
Support
Support

@PabloLabbeImaps I will check the issue internally and get back to you.

Thanks for raising this.

 

AfeefaTk
Support
Support

Hi @PabloLabbeImaps 

We have created an internal ticket to improve the search functionality.

Meanwhile, you can manually fill in the app id in the input parameter.

Thanks

 

GOKULAKANNAN
Creator II
Creator II

Hi @PabloLabbeImaps , thanks for raising it, even am also facing the same issue, As @AfeefaTk  suggested, if you include app id straighty, is it working fine?

PabloLabbeImaps
Partner Ambassador
Partner Ambassador

Hi @GOKULAKANNAN , yes it worked after including the app id manually.

Version history
Last update:
Thursday
Updated by: