Skip to main content

Qlik Sense App: Send Data From The Load Script

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Qlik Sense App: Send Data From The Load Script

Last Update:

Mar 19, 2019 8:01:42 PM

Updated By:

stevedark

Created date:

Nov 4, 2018 4:36:40 PM

Attachments

QlikView has two features which allow it to send alerts and data to the user, using Alerts in the front end or QMC notifications on the Server. Presently Sense lacks these out of the box, but it is possible to implement the same using the free Qlik Web Connectors SMTP Connector.

This application implements the sending of data as an HTML table embedded in an email each time an app is reloaded.

It was produced to go alongside this blog post, which describes the process in detail:

https://www.quickintelligence.co.uk/send-data-from-qlik-load-script/

 

Qlik Sense Email Received.jpg

 

I hope that you find the application useful.  You will find other applications that I have uploaded under my profile on QlikCommunity or on our Downloads page..

Steve

https://www.quickintelligence.co.uk/blog/

Comments
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Johnson_Yao 

Sorry I didn't chip in as you were getting this working, it was overnight for me. 

Pleased to wake up to find you got it all working. Thanks for sharing about the config setting needed to make it work for you. 

Cheers, 

Steve

0 Likes
Johnson_Yao
Contributor II
Contributor II

@stevedarkAnother further question about send picturelike *.png via SMTP connector. Is it possible to send a picture in load script?

0 Likes
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Yes. Refer to the file on disk in the same way as you do the HTML to add an attachment. I'm not sure you can embed one in the message, though I would have thought there will be a way.

You can always put the image on a web server and refer to it there in HTML, or UUEncode the image and have it in plain text.

Good luck!

0 Likes
Johnson_Yao
Contributor II
Contributor II

@stevedark  I write the code:

***<table>
***<tr><img src=file://C:/temp/logo.PNG width=420 height=120></tr>
***</table>

to show the logo successfully.

 

I am continue thinking about how to add iframe which I copied from embed.

I pasted the <iframe> into script like this:

***<table>
***<iframe src=http://localhost:4848/single/?appid=D%3A%5CUserData%5Cz003wnbw%5CDocuments%5CQlik%5CSense%5CApps%5COrder%20intake.qvf&obj=SsCuK&opt=ctxmenu,currsel style=border:none;width:100%;height:100%;></iframe>
***</table>

But when I load the data, the HTML will show as below:

***<table>
***<iframe src=http://localhost:4848/single/?appid=D%3A%5CUserData%5Cz003wnbw%5CDocuments%5CQlik%5CSense%5CApps%5COrder%20intake.qvf&obj=SsCuK&opt=ctxmenu
***</table>

something missed (,currsel style=border:none;width:100%;height:100%;></iframe>). So the iframe cannot be show successfully in the mail.

Would you please help to look into this

0 Likes
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP
The issue is that the comma is being treated as the end of the field in Sense and only the first of two fields on that row is then written out. If you can drop the selection style from the URL then it may then work. Note that it will only work if the email is being read on the Sense server, as you are referring to Localhost. You will need to swap this out with the server address for it to work when received by others. Note that the recipient will also need to have a licence to the server with that object on it. I'm not sure how mail clients will react to the fact you have an iframe in your HTML, they may see it as a security risk and block it. Steve
0 Likes
Johnson_Yao
Contributor II
Contributor II

@stevedarkThank you for your clear explanation! I also think the issue is caused by comma, but I don't know how to solve. I am not familiar with HTML. I will try your solution. I am just working on my local environment for solution validation. So there's no security right now.

 

Thank you very much! Keep in touch.

0 Likes
Johnson_Yao
Contributor II
Contributor II

@stevedarkYes, you are right, outlook react the iframe. 😂 So it is impossible to add qlik app in to email. Right? Do you have any other solution?

0 Likes
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP
I believe that with the API you can call a URL which will create a PNG of the chart you are wanting. This is not something that I have attempted though. Out of the box the best way will be a link that the user clicks to get to the content. If you want a charts in an email, with a UI for setting up and configuring these, then you should look at NPrinting. Alternatively, you can build things in plain HTML and send using the method above. Combine that with https://www.image-charts.com/ and you can get some good looking charts, with a bit of effort and tweaking. Good luck!
0 Likes
AV1
Partner - Contributor II
Partner - Contributor II

Hi Steve,

Thanks for the blog very helpful. But I'm getting noFileSize error. Not sure why its happening as I have encoded the password and I can see the html file getting stored. Can you please help me on that ?

0 Likes
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @AV1 

Happy to help, but I'm not sure at which point you are getting the noFileSize error.

Is it coming from the mail server?

If you copy and paste the URL that is generated by the code into the QWC server does it come back with the same error?

My first thought is that it is permissions on the folder where the HTML file resides from QWC (you set this in deploy.config), but I would have thought that would give a slightly different error.

If you can share some screenshots I may be able to assist further.

Kind regards,
Steve

0 Likes
Version history
Last update:
‎2019-03-19 08:01 PM
Updated by: