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.
-
Starting with a blank automation, add the following blocks one after the other:
- Inputs (basic)
- Apply Bookmark (Qlik Cloud connector)
- Get Measure value (Qlik Cloud connector)
- Get Measure value (Qlik Cloud connector)
- Send message (Slack connector)
Your automation looks like this:
-
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.
-
From the chart options in the assets panel, drag a button object to the sheet.
-
Under Actions and navigation in the properties panel, click Add action.
-
Under Action, select Execute automation.
-
Under Automation, select the automation you want to trigger as an action.
The automations that are available appear in the drop-down menu.
-
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.
-
Optionally, if you want other users with access to your app to be able to run your automation using the button, select Run mode: triggered.
Nota de avisoWhen Execute automation uses Run mode: triggered, everyone with access to the sheet and the button can run the automation using the button. When the button is clicked, the automation's Execution Token is visible in the browser's network traffic in the browser developer console. This token can only be used to run that automation and has no use for other automations or other APIs. A user could use this token to run the automation with a different payload than the one created through the button however. -
Click Copy input block.
When pasted into your automation, it will add blocks for Input and Apply bookmark, passing the button information into your automation.
The button configuration looks like this:
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.
-
Right-click in your automation and select Paste Block(s).
An Inputs and Apply Bookmark block are automatically added to your automation.
-
Click and drag the Inputs and Apply Bookmark blocks after Start.
Your automation should now look like this:
-
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.
-
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.
-
Save the automation.
Run the automation
-
Open your sheet containing the button.
-
Make some data selections.
-
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.