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

tFileExist with external parameter

Hi!

I would like to implement a job which gets a parameter passed via context. So my context includes the parameter "file". I tried String and File so far. Based on this parameter I would like to have a tFileExists task to check if this file really exists.

Unfortunately it seems to, that this context parameter (context.file) is not recongnized by the task. tFileExists is telling me ok in every case.

 

How is the best practice to do such a FileCheck? 

Can someone describe me, why tFileExists is saying that a file exists, even when the context is bogus?

 

Thank you,

   Christian

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

This is a common mistake.

You need an "If" trigger to check the value of the "EXISTS" variable associated to the tFileExists component.

The design should be tFileExists--(If trigger)-->tMsgBox.

If the condition associated to the trigger is "((Boolean)globalMap.get("tFileExists_1_EXISTS"))" and the file exists, the tMsgBox will run.

View solution in original post

4 Replies
TRF
Champion II
Champion II

Share your job design + tFileExists settings

Anonymous
Not applicable
Author

Hi,

it is simple:

Context:
file: c:/null (String)

tFileExist (context.file) -- ok -- tMsgBox "ok"
/-- not ok -- tMsgBox "not ok"

The result is in every case "ok".

Thanks
TRF
Champion II
Champion II

This is a common mistake.

You need an "If" trigger to check the value of the "EXISTS" variable associated to the tFileExists component.

The design should be tFileExists--(If trigger)-->tMsgBox.

If the condition associated to the trigger is "((Boolean)globalMap.get("tFileExists_1_EXISTS"))" and the file exists, the tMsgBox will run.

Anonymous
Not applicable
Author

Thanks. That was helpful...