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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFileExist doesn't show message when added tFileList

Hi There,

I have created a simple job to message me whether file/s exists or not in a folder. 

 

Scenario 1: When I used tFileExist with file name, the job works great. I get message 'File exist' or 'No File exist'.

tFileExist --> If --> tMsgBox (FileExist)

                 --> If --> tMsgBox (NoFileExist)

 

Scenario 2: But i want to use a folder where i can expect different files. So i added tFileList component with wildcard and 'Interated' to tFileExist.

But the job never shows neither 'File Exist' nor 'No File Exist', BUT it finishes successfully. (The attached screenshot has all informations).

Is it a product bug? or am i missing something?

 

I have gone thro many articles, cracked my head, but nothing is useful.

 

regards,

Kiruba

 

Labels (1)
  • v7.x

7 Replies
Anonymous
Not applicable
Author

Hi  

It seems no files are found on tfileList, the other components will not be triggered if there are no files. You need to check the filemask you set.

 

Regards

Shong 

Anonymous
Not applicable
Author

Hi Shong,

 

Yes it doesn't have file now, so i expect that tFileExist would trigger the tMsgBox (NoFile) and would say "no file exist". But it is not. 

 

regards,

Kiruba

 

 

 

 

 

Ganshyam
Creator II
Creator II

Hello,

 

As you don't have the file in tfilelist component it won't trigger and it will not pass any output to the tfileexist component ,as a result tfileExit won't be able to check the IF condition.

 

Other way out.

 

0683p000009M0g5.png

 

Hope this solves your purpose...!!!!

Regards

Ganshyam

Anonymous
Not applicable
Author

Wow Ganshyam.

I have replicated as like yours; When the tFileList_1 has file, the job shows me "File Exist" message. But the job gives me below error when no file in tFileList_1

 

Exception in component tFileList_1 (tFileExist)
java.lang.NullPointerException

 

This is what i tried (screenshot attached), 

 

tFileList_1 --> tFileExist_1 --> If =((Boolean)globalMap.get("tFileExist_1_EXISTS"))  --> tMsgBox

|

If =!((Boolean)globalMap.get("tFileList_1_EXISTS"))

|

tMsgBox (NoFile)

 

regards,

Kiruba


Talend_tFileExist_NullException_Issue.jpg
Anonymous
Not applicable
Author

NOTE: The option "Generate Error if no file found" hasn't been selected in tFileList.
Ganshyam
Creator II
Creator II

Hello,

 

Check the If condition on tfilelist component global variable nb_file.

((Integer)globalMap.get("tFileList_1_NB_FILE")) <= 0

 

Regards

Ganshyam

Anonymous
Not applicable
Author

Thanks a lot. Yea missed to try this formula. Appreciated 0683p000009MACn.png