With the release of shared automations in Qlik Automate, it is now possible to run an automation in a Shared Space for users other than the owner. The automation will run using the owner’s Qlik account and any third-party connections as they were configured by the owner.
When an automation is run by another user, it is possible to retrieve this user’s information during the automation run. This article outlines how this is done.
This is only supported when the automation is run from the console or API. It is not supported for triggered automations when they are run from the trigger URL or webhook automations when they are run from the webhook event. The reason for this is that in these cases, no user subject is sent to the automation (triggered executions use the execution token instead of a user token, and webhook automations have no user involved when they are run by the webhook event).
However, if triggered or webhook automations are run manually or over API, it will be possible to retrieve the user's info.
Identifying the user who started the Automation
When an automation is run by any user, it is possible to retrieve the user id and user info for the user who executed the automation during the automation run.
Use the Get Automation Run block (A) from the Qlik Cloud Services connector and configure it with the Automation ID and Automation RunID (C) formulas from the formula picker (B).
The Get Automation Run block will return the executedByID to identify who has started the automation:
Configure the Get User block to use the executedById parameter as input for the User Id parameter:
You can then use a Condition block to evaluate the returned value from the Get User block.
For example, you can check if the user is a part of a predefined list of users: