Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Tsendmail - not want to send empty file to receiver

Hi,

 

I am using tsendmail to send email with attachment report. But I realized that sometimes there is no data contained in the attachment report - so I am trying to find a way to not send empty file. I checked "don't send empty file" setting in my output component and I also unchecked the "die if attachment not exist" in tsendmail component. However, for below job, I will still receive email but with no attachment in my local server. what I want is to not send the email if the attachment file is empty.

If I still check "die if attachment not exist" I will get the error and the job will stop running. Usually A file is empty.

Can you please help me on this issue? Thanks so much!

 

0683p000009M0LD.jpg

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

Thank you for your reply. I just figured out a simple way to achieve my thought -

In output, go to component tab -> Advanced setting -> check "don't generate empty file"
In tSendmail component, check "Die if file doesn't exist" and then uncheck "Die if error"
In this way my job will run successfully without empty file.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hi,

 

     Could you please try in slightly different way as shown below?

 

      Allow the first subjob to put all the data to your output delimited files.

 

       Verify the NB_LINE value for each file and add this condition as not equal to zero in condition check of run if.

 

        Once you click the NB_LINE value, the value for each file will get converted as below.

 ((Integer)globalMap.get("tFileOutputDelimited_1_NB_LINE")) !=0

      

        If there are zero records, the control will not go to the tsendmail component.

 

0683p000009M0PO.png

 

 

Hope the reply has helped your query. Could you please mark the topic as resolved, if it has helped to close your query? Kudos are also welcome 🙂

 

Warm Regards,

 

Nikhil Thampi

Anonymous
Not applicable
Author

Hi,

Thank you for your reply. I just figured out a simple way to achieve my thought -

In output, go to component tab -> Advanced setting -> check "don't generate empty file"
In tSendmail component, check "Die if file doesn't exist" and then uncheck "Die if error"
In this way my job will run successfully without empty file.

Anonymous
Not applicable
Author

Hi,

 

     That is awesome news. There are always multiple ways to arrive at solution for same problem.

 

      Could you please mark the topic as resolved so that it will help our fellow Talend community members?

 

Warm Regards,

 

Nikhil Thampi