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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Die if file doesn't exist - multiple files but only one not exist

Hi,

 

Please advise me below problem. Thank you!  

I attached multiple files in tSendmail and have three situations when I run the job

1. one file doesn't exist but other files contains data

2. no files exist 

3. All files contain data

What I am trying to achieve is below - 

When 1st situation - I still want to send receiver email

When 2nd situation - I don't want my receiver receive any email

When 3rd situation - I want to send receiver email

For now I can't achieve above results flexibly

 

Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi
Using tfileExist to check each file if they exist, parse the checking result and determine to trigger tsendMail or not using runIf connector. eg:
tfileExist1-oncomponentok-tfileExist2-oncomponentok-tfileExist3--tJava--runIf--tSendMail.

On tjava: get the checking results and parse them.
boolean file1=((Boolean)globalMap.get("tFileExist_1_EXISTS"));
boolean file2=((Boolean)globalMap.get("tFileExist_1_EXISTS"));
boolean file3=((Boolean)globalMap.get("tFileExist_1_EXISTS"));

if(file1==true||file2==true||file3==true){
globalMap.put("isContineue",true);
}else{
globalMap.put("isContinue",false);
}

set the condition of runIf as:
(Boolean)globalMap.get("isContinue")

Regards
Shong