Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Jul 1, 2022 8:00:32 AM
Oct 16, 2020 12:03:31 PM
I spent a bunch of time on and off trying to figure how to generate an email alert when a reload fails. It's something I and I'm sure many others wish was built-in and worked out-of-the-box, but it's actually somewhat possible. There are some restrictions - for me, I sometimes get reloads that hang, even though I put in a max retry, and since they don't "fail," I never get the notification. And obviously, the email notification is generalized to the point where you have to log into the QMC to discover which app failed. But if you're a Qlik Sense admin, you're smart enough how to make customized email alerts for each reload task :).
Setting up Qlik Web Connectors
Setting up Task Failure Triggers
Editing the Notification App
As written above, the actual script that runs the SMTP Connector is complete and already published to Qlik Sense. In other words, if you ever need to edit or re-publish the app or change the SMTP settings, there is little to do. Details below:
[Redacted] QS Script for Send Email app
/**** you shouldn't have to modify these after setup ****/
let vQwcConnectionName = '[web file connector]';
let vTimestamp = timestamp(now());
/**** Edit these variables to change the email contents. ****/
let vMessageInput = 'Qlik Sense Task Failure at ' & '$(vTimestamp)' & '.<br><br>To Review, <a href="https://[Qlik Sense URL].com/qmc">go to the QMC.</a>';
let vSubjectInput = 'Qlik Sense Task Failure';
let vSMTPserver = ' ';
let vFromName = ' ';
let vSMTPPort = '25';
/**** use %40 in place of the @ symbol ****/
let vToEmail = '';
let vFromEmail = '';
/**** DO NOT EDIT ****/
/**** These variable text strings properly encode the text in the "input" variables ****/
/**** Replaces all spaces with plus signs in the message string above ****/
let vMessage = replace('$(vMessageInput)',' ','+');
let vSubject = replace('$(vSubjectInput)',' ','+');
/**** DO NOT EDIT ****/
SMTPConnector_SendEmail:
LOAD
status as SendEmail_status,
result as SendEmail_result,
filesattached as SendEmail_filesattached
FROM [$(vQwcConnectionName)]
(URL IS [http://localhost:5555/data?connectorID=SMTPConnector&table=SendEmail&SMTPServer=$(vSMTPserver)&Port=$(vSMTPPort)&SSLmode=None&to=$(vToEmail)&subject=$(vSubject)&message=$(vMessage)&html=True&fromName=$(vFromName)&fromEmail=$(vFromEmail)&delayInSeconds=0&ignoreProxy=False&appID=], qvx);
// IMPORTANT: If, when loading the above script, you receive a 'Script Error' Dialog box with a 'Field Not Found'
// (or other) error, the first thing you should do is copy and paste the full request URL (i.e. the URL between the square [...]
// brackets IN THE QLIKVIEW / QLIK SENSE SCRIPT ERROR DIALOG) into a browser address bar and check the response.
Hi,
Is it possible to get the specific task name that fails and the logs attached to the alert email?
Thanks
Hi @jpjust
If you are still looking for a solution, we have been using this for just over 2 years now and it is still running without any issues.
Qliksense Automated Task Failure Email Alerts - Qlik Developer
Hello @williejacobs ,
we also use this extension, but sometimes mails about task cancellations are sent to wrong persons. Do you know this phenomenon and have you found a solution?
Best regards
Hi @mdelvecchio
Thanks for that good explanation! That works well for me 🙂
I would like to send e-mail to multiple recipients using the blind carbon copy (bcc).
I thought I could simply change the "to" parameter into "bcc", but that doesn't work.
Is there a way to put recipients into the bcc field?
Best regards
Gino
@luigi_nigro , you will always need to use the TO parameter. Use a dummy address or the service account in the TO parameter and the recipients in the BCC parameter.
@mdelvecchio you could use the QRS connection to read the repository database. In the database you will find all the tasks, the task results, the task names, the owner of the task, the owners of the connected app, etc. With these details you can create notifications with more specific details.
I did this with very easy solution
Hey, @mdelvecchio & everyone else,
I've been following the discussions and am particularly inspired by this thread on setting up Qlik Sense to send email notifications on reload tasks. I wanted to share my enhancement to this process, which I believe could provide additional value to others in the community.
I've developed a script that sends email notifications and includes dynamic content, such as the latest reload status and a detailed HTML report of the task outcomes. This adds a layer of insight right into the email, allowing quicker reactions to task failures and a clear overview of the system's health throughout the day.
You can find the full implementation on my GitHub repository:
https://github.com/FahadAbdu3/Qlik-Sense-Reload-Log-Automation/tree/main
Feel free to explore the repository and reach out with your thoughts or suggestions on further enhancements or any issues you might encounter.