Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
scottduthie
Partner Ambassador
Partner Ambassador

Who has the rights to start an automation from a button action in a published Qlik app?

Hi Community,

We have a task chain being run by application automation - we want a user to be able to start the task chain by clicking a button in an app. The use case: The task chain will go and fetch the latest data from the DB and update the app on the spot for the user.

Who has the rights to start an automation? What role would they need?

I have tested this by placing a button in an app in a managed space - the button has an action to start the required automation. I then log in as a normal business user who has the roles 'Can View', 'Can Contribute' and 'Can Consume Data', however clicking the button will not start the automation. I can't think of why the user would need 'Can Manage' or 'Can Publish' roles, but have also given the user these roles and this makes no difference.

Note: The user account has none of the 7 'User' or 'Admin' roles allocated via the console.

 

 

Labels (2)
2 Solutions

Accepted Solutions
PietMichielRappelet
Former Employee
Former Employee

Hi @scottduthie 

There are 2 options to run an automation via a button in a sheet:

1) use 'actions = execute automation'. This will run the automation in the background but is only applicable for your own automations. Please note that today you cannot 'publish' or 'share' automations with other users. 

PietMichielRappelet_0-1637661440574.png

 

2) Execute a triggered-based automation in the tenant of the owner of that automation. A triggered automation can be called from anywhere, including a button in a sheet from a separate tenant.  You put your automation on triggered in the 'start' block, where you'll find the curl to use as navigation for your button. 

PietMichielRappelet_1-1637661532848.png

 

interesting link: https://community.qlik.com/t5/Knowledge/Triggering-an-automation-from-a-button-on-a-sheet/ta-p/18528... 

View solution in original post

jmbenedetto
Employee
Employee

Hello, Piet. 
Thanks for your reply. I did everything you suggested. Then, I understood the problem.

To test if the automation was working when I was not the owner, I changed the automation ownership to another team member and clicked on the button.

What I didn’t know is that the execution token changes when you do that. And that was the issue.

There is no mention of this on the documentation, so if I’m right it may be an useful addition. 

Regards. 

View solution in original post

14 Replies
PietMichielRappelet
Former Employee
Former Employee

Hi @scottduthie 

There are 2 options to run an automation via a button in a sheet:

1) use 'actions = execute automation'. This will run the automation in the background but is only applicable for your own automations. Please note that today you cannot 'publish' or 'share' automations with other users. 

PietMichielRappelet_0-1637661440574.png

 

2) Execute a triggered-based automation in the tenant of the owner of that automation. A triggered automation can be called from anywhere, including a button in a sheet from a separate tenant.  You put your automation on triggered in the 'start' block, where you'll find the curl to use as navigation for your button. 

PietMichielRappelet_1-1637661532848.png

 

interesting link: https://community.qlik.com/t5/Knowledge/Triggering-an-automation-from-a-button-on-a-sheet/ta-p/18528... 

scottduthie
Partner Ambassador
Partner Ambassador
Author

Great - thanks for the clear guidance.

Executing a 'triggered-based' automation should solve our issue.

In an ideal world, the app would be on a reload schedule, say every 30 minutes, but if a user wanted to load new data into the app on the spot they could click a button in the app to trigger the task chain via the automation immediately. This would require our automation to have two different start conditions though - one 'scheduled' and one 'trigger' based. It doesn't look like you can have two Start blocks though - is that correct? Could you suggest a workaround to achieve this functionality?

Thanks,

Scott.

PietMichielRappelet
Former Employee
Former Employee

Hi @scottduthie 

You are correct, you cannot have 2 'run' options for 1 automation. 
I see 2 workarounds,

  • you simply copy your automation (export/import workspace, copy the blocks) to a new automation with different run mode
  • you have one triggered automation, calling the scheduled automations through the 'call automation' block.  This way you'll not have to duplicate your automation, downside is that you'll run 2 automation on the triggered use case. 

 

PietMichielRappelet_0-1638174569898.png

 

scottduthie
Partner Ambassador
Partner Ambassador
Author

Hi @PietMichielRappelet,

Just a quick follow-up on this thread....

I have successfully kicked off the automation from a button in an app - the automation is set up in 'Triggered' Run Mode and we're using 'Open a website or email' Navigation option on the button to call the API end point for the start block.

The last issue we have is that when clicking the button the user gets taken to a new browser tab (or you can check the box to have this open in the same browser tab) and shown the following message:

{"status":"queued","guid":"ea768d40-515c-11ec-9213-8f276f2b37ad"}

Is there any way to stop this happening?

The app is reloading fine back on their original browser tab, however this message is confusing users.

 

 

PietMichielRappelet
Former Employee
Former Employee

Hi,

 

If you are calling a triggered automation, this means you are calling it as if it is an API endpoint, so the response of the automation will always be JSON data, and that's what the user will see in the browser.

It looks like your automation is set to run async, this means it will be queued and run in the background. If you set it to "Run asynchronously = No", then the actual output of the automation will appear in the browser.

You can use the Output block to provide a response, but again it will always be JSON data. In the output settings, you can select the display mode to return the output in a list or not. 

Please also keep the run time limitation of 1 min in mind for in sync triggered automations: https://help.qlik.com/en-US/cloud-services/Subsystems/ApplicationAutomation/Content/introduction/pla... 

scottduthie
Partner Ambassador
Partner Ambassador
Author

Thanks @PietMichielRappelet .

I have tidied up what is returned in the JSON response a little so that in the new browser tab that opens it just displays the following: 

["New data request started at: 2021-11-30T19:04:45Z\n- you may now close this browser window."]

I couldn't see how to change the output settings display mode to display a list instead of the raw JSON - so I just chose to show the timestamp. Maybe not the best solution but at least it tells the user to close the browser tab and carry on with their analysis. Let me know if you have a better idea on how to handle this.

What would be great would be an action on the button that could just call and API endpoint without any navigation.

Thanks,

Scott.

AronC
Partner - Creator II
Partner - Creator II

I am also struggling with the same thing. @scottduthie  How did you create that JSON response? I also have a task chain with several apps that takes longer than 1 minute. Therefore I must set "run Asynch.." to yes. I can only manage to print a response when I set it to no, but my output isn't printet out untill the end of the aoutomation. I have tried different workarounds and to break out a first automation that only triggers the second, but nothing works out for me. Could you please post how you managed to print that response for your task chain.

Thanks in advance 🙂

Aron

AronC
Partner - Creator II
Partner - Creator II

I just solved it. I am using two automations. One with the acutal task chain and one first automation that only has two blocks, an output with the text. "The task chain has started, you can now close the windows" and a Call URL block.  It didn't workout if I used the block "Call automation" because it then waits for the automation that I called. But using call URL and then set the runout to 0 I get what I want. 

scottduthie
Partner Ambassador
Partner Ambassador
Author

Great to hear you got it working @AronC !