Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I've been asked to create an NPrinting task (ver. Nov 2017) that ships a report to a bunch of users. The tricky part is that I have to use a different email message based on a variable value from Qlik Sense (ver. Nov 2017). I figured "Hey! I can use the embedded reports feature!", but I've had some issues.
Where I'm at: I've created an HTML report with my message, then added the HTML report to my task and embedded it into the email message - works great. The text from the HTML report is in my email. But I've hit a roadblock when trying to conditionally decide which message should be included.
What I've tried:
I'm not quite sure how to accomplish this, other than creating a separate task for each message, running all the tasks and using conditions on the actual reports so that only one of the tasks actually sends something. Really don't want to go down that road (what if I have 10 different messages??)
Thanks!!
I cant wait to get my hands on the embedded functionality. Need to get my upgrade done.
On the only message front could you add your message into the Qlik Sense App with a flag to id message 1, 2 3 etc... and then use the user filter to filter down to the mesage you want to display that way you will just have one message field in your report. My guess is they have some role that determines their communication method.
Hey Andy, thanks for the help - this made me think to try creating a Qlik Sense variable for each message, then use a separate variable to handle the conditional message selection. I then tried to drop this variable into the NPrinting report as a variable/formula (tried both). Unfortunately the problem is still that I need to include the HTML markup into the message, and NPrinting sees the markup as text rather than HTML tags. There could be something I'm missing here.
I then tried to use javascript within the HTML report. I got this to work:
The javascript:
<script type="text/javascript">
function showMessage()
{
document.getElementById("Full").style.display = "none";
document.getElementById("Meets").style.display = "none";
document.getElementById("Below").style.display = "none";
document.getElementById("%%MessageType%%").style.display = "inline";
};
</script>
The HTML report body:
<body onload="showMessage()">
<div>
<p> Your current status known compliance is %%ComplianceRate%% </p>
<div id="Full">
<p>You're awesome - fully compliant!</p>
</div>
<div id="Meets">
<p>You're doing great!</p>
</div>
<div id="Below">
<p>You're getting there</p>
</div>
</div>
</body>
The MessageType formula expression using my Qlik Sense variable:
if($(vPercentInfluenzaStatusKnown) = 1, 'Full',
if($(vPercentInfluenzaStatusKnown) >= 0.8, 'Meets',
'Below'))
The above works for a HTML report when viewed in the browser, but the javascript doesn't execute when embedded into an email .I realized later that this is probably because it's a potential security risk (I know next to nothing about javascript). Sigh.
I'm giving up on this for now. If I figure it out I'll post in this thread.
<SCRIPT > I have been there, I have done that..
I tried also use script in my html to build google charts and hit the same roadblock and I gave up realisisng that mail client will not support it - SHAME
------------------------------------------------
Back to your question:
If you want to go this path you will have to handle all in Qlik Sense / QlikView side. So depending on variable you need to produce outcome.
Things you need to consider are:
example:
Let vVar1 = 'Today is Monday the first day';
Let vVar2 = 'Today is Tuesday the second day';
Let vVar3 = 'Today is Wednesday the third day';
above you have 3 variables. What you currently are doing is looking at them as a separate objects and want to apply condiotion which of them you want to show in NPrinting- right?
My idea is that you only need to have one variable like:
Let vSingleVariable = If(condition1 = true(), vVar1,If(condition2 = true(), vVar2,If(condition3 = true(), vVar3.... etc...)))
then in NPrinting you only use vSingleVariable to show your message, and its content gets calculated in Qlik.
Obviously i have presented example with variables, maybe you have charts, textboxes or whatever - still, the principle is the same.
Can you share a mockup what is your variable, how is it calculated? Is it recipient based? and what is your report scenarios likely looking like (template).I am sure we will find a solution for your request as it seems to be achievable.
regards
Lech