Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
alenb
Partner - Contributor III
Partner - Contributor III

How to run a script when user opens an application

I'm trying to record usage of the app, so I wrote this script. However, it only runs if I click on a button LOAD DATA in the top right corner of my "Data load editor", and the data gets saved to the QVD.

How can make this code execute whenever the user opens the app? Bonus question - how can I also make it run when they open certain sheets within the app?

 

Set os_user = SubField(SubField(OSUser(), ';', 2), '=', 2);

ANALYTICS:
LOAD
App,
"OSUser",
"TimeStamp"
FROM [01_ANALYTICS.qvd]
(qvd);

Load
'ABTestApp2' as App,
$(os_user) as OSUser,
Now(2) as TimeStamp
AutoGenerate 1;

Store ANALYTICS Into "01_ANALYTICS.qvd"(qvd);

Labels (1)
4 Replies
David_Fergen
Former Employee
Former Employee

Hi alenb,

For opening with a script. Have you tried adding in a load script using the Data load editor? You can follow this article here which will explain how to do that. 

Let us know if you have any other questions.

Thanks,

David

ArnadoSandoval
Specialist II
Specialist II

Hi @alenb 

Perhaps the Telemetry Logging  is the way to go for you, take a look at this video as well Qlik Sense Telemetry Dashboard - Part 3: Analysis 

Hope this helps,

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
alenb
Partner - Contributor III
Partner - Contributor III
Author

I think I probably wasn't very clear in my question.

 

For opening with a script. 

It's not about opening with a script. It's about running the script when a user opens the app.

Have you tried adding in a load script using the Data load editor?

The script I posted is indeed in the "Data load editor", but it doesn't seem to run when a user opens the app, only when I explicitly click on the "Load data" button. My questions is how to force the script I wrote in "Data load editor" to run every time user opens the app.

You can follow this article here which will explain how to do that. 

Maybe you posted wrong link, this one is about how to open an app without the script. I want to know quite the opposite: how to force the script I wrote in "Data load editor" to run every time user opens the app.

 

Thanks

 

alenb
Partner - Contributor III
Partner - Contributor III
Author

Hi, I'm working on a centrally managed cloud installation of Qlik Sense, so I don't have the privileges to install anything new. I have to rely on data I can capture in runtime and store into QVD's.