Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
mobmsc2
Creator
Creator

Read file if file name contains

I have a folder of excel files, there is a common file naming scheme which indicates what schema should apply to the file. 

I am trying to use this Run If condition to connect the tFileList1 to an appropriate tFileInputExcel

((String)globalMap.get("tFileList_1_CURRENT_FILE")).contains("FileType1")

but the contents are not read, the if condition is returned false even though the filename contains the string.

 

I have tried 

 

tFileList ------tIterateToFlow --if- tFileInput

and 

tFileList ---if--tFileInput

 

Any ideas what I am doing wrong?

Labels (2)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

just connection for iterate from tFileList

 

normally RunIf fire when component finish work, so on each iteration when empty tJavaFlex finish it zerro work it fire a trigger for each iteration, but not once when tFileList finish it work

View solution in original post

10 Replies
vapukov
Master II
Master II

why You just not use filename pattern for tFileList?

 

"*FileType1*"

and then iterate over all matched files

mobmsc2
Creator
Creator
Author

If you mean using the filemask to only select files to be read? I need to process all the files but I need to process some differently depending on their structure (there is a reason why they are in the same folder). Wouldn't having multiple tFileLists on the same folder open the possibilities of file locks?

mobmsc2
Creator
Creator
Author

If you mean using the filemask to only select certain files to be read? I need to process all the files but I need to process some differently depending on their structure (there is a reason why they are in the same folder). Wouldn't having multiple tFileLists on the same folder open the possibilities of file locks?

vapukov
Master II
Master II

ok, in this case:

 

0683p000009M1bV.png

 

 

tJavaFlex - empty

RunIf - Your condition

tFixedFlowInput - replace with tExcelInput

mobmsc2
Creator
Creator
Author

My 1st problem is that my If condition doesn't evaluate to True. Any advice how i debug that?

vapukov
Master II
Master II

as you can see from screenshot - it work

 

so, check your condition and real filenames pattern,

is it really contain - 

FileType1

 ?

mobmsc2
Creator
Creator
Author

What is the purpose of the tJavaFlex? The run if works now (copied from my original process)  but I swear it doesn't if you have the tFileList ---RunIf--tFileInputExcel

 

 

vapukov
Master II
Master II

just connection for iterate from tFileList

 

normally RunIf fire when component finish work, so on each iteration when empty tJavaFlex finish it zerro work it fire a trigger for each iteration, but not once when tFileList finish it work

mobmsc2
Creator
Creator
Author

Can I ask a follow up how you could join (Unite) the flows into 1 flow once any custom processing had been completed?