Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Trigger a task from a button action in UI

Hello
I have a qlik sense dashboard
I want to trigger a task in QMC by pressing a button on the UI
is this possible?
kindly advise on how to accomplish this

Regards,

I can walk on water when it freezes
Labels (1)
1 Solution

Accepted Solutions
ali_hijazi
Partner - Master II
Partner - Master II
Author

I just followed the link
but there seems no indication to triggering an NPRINTING task but mainly refresh and app without going throug the script editor etc...:

Simple extension, that

  • allows a developer to refresh an already published app with a new design from a copy of this app (standard process)
  • allows to reload the app without going through script editor (using QRS API - also works when app is already published)
  • (new Feb 2021) allows to export the app, and at the same time choose which sheets should be exported and with/without data
I can walk on water when it freezes

View solution in original post

5 Replies
Scotchy
Partner - Creator
Partner - Creator

Short answer is no... some alternate considerations are:

In Qlik Sense, triggering a task in the Qlik Management Console (QMC) directly from the dashboard UI isn't a built-in feature, as QMC tasks are typically managed within the QMC itself and not from the dashboards. However, you can implement a workaround using Qlik Sense APIs and custom actions:

Here’s a high-level overview of how you can accomplish this:

  1. Qlik Sense APIs: Qlik Sense exposes APIs that allow for programmatic control over various aspects of the platform, including task management. The Qlik Sense Repository Service (QRS) API can be used to start tasks.

  2. Custom Button: You would need a custom extension that allows you to add a button to your dashboard UI. This button would trigger a call to the QRS API when clicked.

  3. Web Service Middleware: Due to same-origin policy and other security considerations, you cannot call the QRS API directly from the client-side in a web browser. Instead, set up a middleware web service that your custom button can safely call. This service would then be responsible for making authenticated calls to the QRS API to trigger the task.

  4. Security Considerations: Ensure that all interactions with the QRS API are secure, and that any service or extension you create adheres to your organization's security policies. Use service accounts with the least privileges necessary to perform the task.

  5. Implementation Steps:

    a. Custom Extension: Develop a Qlik Sense extension with a button using the Qlik Sense Extension APIs.

    b. Middleware Service: Create a web service (using Node.js, Python, or any other backend technology) that authenticates with the Qlik Sense QRS API.

    c. Trigger Task: Write a function in your web service to trigger the reload task by sending a POST request to the QRS API endpoint for starting tasks.

    d. Button Action: Configure the button in your custom extension to make a request to your middleware service when clicked.

    e. Handle Responses: Make sure your extension handles responses from your middleware appropriately, such as displaying success or error messages.

  6. Testing: Thoroughly test the extension and the middleware in a development environment before deploying to production to ensure it works as expected and is secure.

This approach requires a good understanding of web development and Qlik Sense APIs. If you're not familiar with these, you may need the assistance of a developer or a Qlik partner.

It's also worth noting that Qlik Sense's APIs and capabilities are updated over time, so you should refer to the most recent Qlik Sense developer documentation for the latest instructions and best practices.

steeefan
Luminary
Luminary

I'm using this extension to achieve this in one published QS application: https://github.com/ChristofSchwarz/qs_ext_reloadreplace

ali_hijazi
Partner - Master II
Partner - Master II
Author

I just followed the link
but there seems no indication to triggering an NPRINTING task but mainly refresh and app without going throug the script editor etc...:

Simple extension, that

  • allows a developer to refresh an already published app with a new design from a copy of this app (standard process)
  • allows to reload the app without going through script editor (using QRS API - also works when app is already published)
  • (new Feb 2021) allows to export the app, and at the same time choose which sheets should be exported and with/without data
I can walk on water when it freezes
steeefan
Luminary
Luminary

That's correct, you cannot trigger an Npriting task with that extension, only those available in the Qlik Sense QMC. Is that not what you asked?


@ali_hijazi wrote:
I have a qlik sense dashboard
I want to trigger a task in QMC by pressing a button on the UI
is this possible?

 

ali_hijazi
Partner - Master II
Partner - Master II
Author

Oops 
sorry I thought I'm replying to another thread
well yes this might solve the issue I want to tackle

I can walk on water when it freezes