Skip to main content
Close announcements banner

Active intelligence

Automations help you build out active intelligence workflows by bringing real-time information directly to those who need it. In this tutorial, you'll learn how to send data from your analytics app to your team with the click of a button. By the end of this tutorial, you'll be able to trigger an automation to send a Slack message that includes the value of a master item from a button object on a sheet.

Context

This tutorial is general enough to apply the same principles to an app you currently have in development. The only requirements to follow along with this tutorial are that you have a personal app with at least one master item. If you need to create a master item in your app before you start this tutorial, see master item.

Create the automation

The automation you create in this tutorial is a simple alerting automation that is executed from a button inside the app. The button creates a bookmark for the current selection and sends the app ID and bookmark ID to the automation. The automation retrieves some measure values based on the bookmark selection and sends a message to Slack.

The first step is to outline the automation without configuring it yet.

  1. Starting with a blank automation, add the following blocks one after the other:

    • Inputs (basic)
    • Sleep (basic)
    • Apply Bookmark (Qlik Cloud connector)
    • Get Measure value (Qlik Cloud connector)
    • Get Measure value (Qlik Cloud connector)
    • Send message (Slack connector)
    • Delete Bookmark (Qlik Cloud connector)

    Your automation looks like this:

    Simple notificiation automation that is triggered from a button

  2. Save the automation.

    You'll configure the automation later.

Create the button

Qlik Sense SaaS lets you add buttons to your sheet, which can be configured to execute automations. Open your app and add a button object to a sheet.

  1. From the chart options in the assets panel, drag a button object to the sheet.

  2. Under Actions and navigation in the properties panel, click Add action.

  3. Under Action, select Execute automation.

  4. Under Automation, select the automation you want to trigger as an action.

    The automations that are available appear in the drop-down menu.

    drop-down menu for automation action button

  5. Select the Include selections box.

    When you select this option, the button creates a bookmark for the current selection. The app ID and bookmark ID are used as inputs to the automation, and they are used to apply data selections when executing the automation.

The button configuration looks like this:

Button configuration to run an automation

Button configuration settings to execute automation action

Information note

You can style and label your button however you want.

Configure the automation

In this part of the tutorial, you'll configure the automation that you created earlier.

  1. Select the Inputs block and add two items as inputs:

    • Label: app_id

      Input type: Single input line

      This field is required: yes

    • Label: bookmark_id

      Input type: Single input line

      This field is required: yes

    When you click the button on the sheet, the app ID and a bookmark ID are passed to the input block. This block is always required when you want to include data selections.

  2. Select the Sleep block and set the time to 5 seconds. This is sufficient for the data to be passed from the app to the inputs block.

  3. Select the Apply Bookmark block. Field map the app_id and bookmark_id values from the Inputs block output. This applies the bookmark to the app so the subsequent blocks get data based on that selection.

    The automation including a bookmark block

  4. Select the Get Measure Value block. Use the do lookup function to map the app ID and measure ID you want to use in this automation. Repeat this for the second Get measure value block.

    The do lookup field from a Get measure block

  5. Select the Send Message block. The only required fields are Channel and Text. Once the Slack connection is authenticated, you can use the do lookup function to select a Slack channel.

    a. Open Slack and invite the Qlik Application Automation app to the channel. You can do this with the /invite slash command, then select Add apps to this channel.

    b. In the block inputs text field, customize a message and include the output from the Get Measure Value blocks.

    alt

  6. Select the Delete Bookmark block. In the App ID and Bookmark ID fields, map the app_id and bookmark_id output values from the Inputs block. This block removes the bookmark that is created by the button.

    Information note

    This block is optional, but if you want to remove bookmarks created by the button each time it is clicked, you should include it.

  7. Save the automation.

Run the automation

  1. Open your sheet containing the button.

  2. Make some data selections.

    Button on a sheet with a data selection

  3. Click the button to send the Slack message. The values included in the message correspond to the data selections. You can test this by making different selections in the app and clicking the button.

    Resulting message from the button