Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlik_BI_Dev
Contributor
Contributor

Qlik Sense variable and NPrinting email recipient problem

Hi team,

We are using the Qlik Sense Nov 2021 enterprise edition. 

Qlik NPrinting May 2021 SR3 Version: 21.14.7.0


We need to send NPrinting emails using Qlik variables (Dynamic email list (TO, CC and BCC)).
In the data load script, we are assigning email ids to the same variable within a loop and executing the NPrinting tasks using REST APIs. In the task email message, this qlik variable is assigned to the email list (To, CC, and BCC).  When the data load script is run, the number of emails sent is matching the loop count. However, all the recipients within the loop are not receiving the emails consistently. Either multiple emails are sent to the 1st email id or the last email id is receiving multiple emails. We tried reloading the connection metadata as well, but no luck.

Are we doing anything incorrectly? Please provide the solution to fix this problem.

Thanks!

Labels (2)
7 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

1. Check your smtp server settings with your smpt server admin - maybe anti spam kicks in and stops distribution. The fact that it sends to some and not to all suggests there is possibly issue there. 

2. Another thing to check is the user/group user used in publish taks. Do you use some dummy user for this distribution?

3. In your API call do you have any QuerryLimit parameters? 

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
durgesh22
Creator
Creator

@Qlik_BI_Dev 

Try creating variable with all the required emailid concatenated for TO, CC and BCC and then use these variables in NP.

The approach you are taking i guess it should not work, as variable is assigned once reload is completed for QS app. and that is the reason you are getting either 1st or last email in variable

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

hi @durgesh22 

I disagree. Have you considered variables which are expressions and which evaluate based on user selections/filters? 

You are right that variable needs to produce array of emails but it can be dynamic when designed properly.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
durgesh22
Creator
Creator

Hi @Lech_Miszkiewicz 

Please correct me  i might be wrong.


Qlik variable in NP holds the latest value of variable at the time of reload is completed.  
In above Case app is still reloading and variables value is changed as per loop but it is not getting refreshed in NP till it completes the reloading.
and when we are trying to access the value of variable, it will give us value of variable which was present when app last reloaded successfully.  

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @durgesh22 

I think we are both misunderstanding what is happening here. 

Qlik variable in NP holds the latest value of variable at the time of reload is completed.   - you are right - the definition of variable is the last one set in the source app reload, however what I had in mind was that this definition value can be expression which can be altered by things like filters applied in NPrinting task or user filters. The value itself can simply be updated by NPrinting variable filter too. So depending on the approach used in the solution you may get different results. 

In overall whole setup seems little strange - I think that knowing the whole requirement would allow us to come up with simpler working solution. 

You are saying : "In above Case app is still reloading and variables value is changed as per loop but it is not getting refreshed in NP till it completes the reloading." - I understood that differently as I think @Qlik_BI_Dev is not reloading source app but instead different app. Therefore the variable in Qlik Sense app is unchanged and only separate app (used to run NPrinting API call) updates NPrinting variable filter - which is what I thought was happening. 

To me process would be:

  1. Reload QS source app
  2. Start reload of another QS app which triggers NPrinitng API and:
    1. Reloads NP metadata (not necessary - but just in case worth having)
    2. Enters loop and
      1. Updates NPrinting variable filter (that filter is array of all required email for that loop value) https://help.qlik.com/en-US/nprinting/May2021/APIs/NP+API/index.html?page=28
      2. Triggers task
        1. Checks if finished
      3. Updates NPrinting variable filter (that filter is array of all required email for that loop value)
      4. Triggers task
        1. Checks if finished
      5. Updates NPrinting variable filter (that filter is array of all required email for that loop value)
      6. etc...
        1. Checks if finished

That would be solution with variable update by used of API to update variable filter. 

 

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Qlik_BI_Dev
Contributor
Contributor
Author

Thank you, Lech and Durgesh! I really appreciate your quick response.

My requirement is simple.

I have to filter the data in Qlik Sense and select one or more email ids where I want to email the NPrinting report with a click of a button. Same time I also want to preview the report and print it.

Please provide your thoughts. Thanks!

 

 

 

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Well - there is no out of the box option to do that so it needs to be custom build hence i do not consider this simple🤣🤣

It would be simple if you could use NPrinting OnDemand with Qlik Sense (that can solve your preview requirement), however using it will not send those reports to selected emails which is your first requirement.

On the other hand creating API solution requires you to build custom solution and my idea is that you are doing following:

Possible issues:

  • this setup can only work for single Qlik Sense user (one user using solution at the time) as there are no multiple sessions for NPrinting. The result is that once filter is updated task needs to run before next user can filter report again. The reason for it is that filters in NPrinting cannot be As opposed to OnDemand report generation where users can have their individual sessions

thats how i see it.

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.