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

How cant get destination filename in tFileCopy component

Hi,
Destination filename is composed with date and time and so is variable.
Is there any way to get later on the flow this filename ?
Labels (2)
4 Replies
Anonymous
Not applicable
Author

hmmm, interesting, you're right. the only thing that shows up in the CTRL+SPACE list is tFileCopy_1.ERROR_MESSAGE (aka: ((String)globalMap.get("tFileCopy_1_ERROR_MESSAGE")) )
you can post a bug on the bugtracker and make it a feature request and ask for these parameters to be added to the "Basic Proposals" or whatever:
FileName
DestinationDirectory
DestinationFilename

but, in the meantime you could put a tJava component before your tFileCopy (or tJavaRow, depending on which one works in your job) and set the Destination Filename value to a context variable, and then call that context variable in tFileCopy. And then you could be able to call that context variable wherever else you want it
Anonymous
Not applicable
Author

you can post a bug on the bugtracker and make it a feature request and ask for these parameters to be added to the "Basic Proposals" or whatever:
File Name
Destination Directory
Destination Filename

it looks like Destination Directory and Source Directory global variables are being added to tFileCopy: 4868
Add the ability of coping an empty directory, rename '"Copy_DIRECTORYPATH"
to "SOURCE_DIRECTORY, add external global variable "DESTINATION_DIRECTORY"

the target version for that fix is, currently, TOS 3.0.0M4
Anonymous
Not applicable
Author

Hi,
Jessica is absolutely right. But if you would like to avoid the additional tJava you can use the following code in tFileCopy for your filename. This is possible because in java the value of an assignment is the value itself:
context.fileName="C:/temp/files/"+TalendDate.getDate("CCYYMMDDhhmmss")+"_input.xml"

Bye
Volker
Anonymous
Not applicable
Author

Perfect, thank you for all your answers.