Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We have one application that is loading data from multiple databases. We set custom properties on the reload tasks to indicate the location of the database and the environment. We need to determine which reload task is running so that we can control the access to the appropriate databases.
Example:
We have one Qlik Sense App 'Extract App' in the 'Dev Stream'.
We have 3 scheduled Tasks each triggering the same 'Extract App' at different times. Each task has a custom property 'Customer Name'. The Task configuration looks like this:
Task 1: Execute daily @12pm / Customer Name = 'Customer1' / Trigger App 'Extract App'
Task 2: Execute daily @1pm / Customer Name = 'Customer2' / Trigger App 'Extract App'
Task 3: Execute daily @2pm / Customer Name = 'Customer3' / Trigger App 'Extract App'
When 'Extract App' is running, how can I determine which Task triggered the reload?
Can anyone help us get this information via the QRS API?
Something like this will return the "running" task associated with the App you are reloading.
you will need the ReloadTask/Full api. /qrs/reloadtask/full
called with a filter for the App and Operational Status
filter=App.id eq <YourAppID> and operational.lastexecutionresult.status eq Running
e.g.
if you are calling this from within the Load Script of the running App, you can use the System Function DocumentName() to dynamically get the AppID.
NB: If you are reloading from the Data Load editor you may need to handle a empty response