Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I have to download a zip file from
https://leidata.gleif.org/api/v1/concatenated-files/lei2/20180622/zip
but I want to use a date variable to download every day
I use tFileFetch and with direct link works.
Can somebody help me?
Thanks
You can try this:
"https://leidata.gleif.org/api/v1/concatenated-files/lei2/" + TalendDate.formatDate("yyyyMMdd",TalendDate.getCurrentDate()) + "/zip"
I gave this error:
Execution failed : Job compile errors
At least job "test" has a compile errors, please fix and export again.
Error Line: 559
Detail Message: Syntax error on token "yyyyMMdd", invalid AssignmentOperator
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.
I put this on URI "https://leidata.gleif.org/api/v1/concatenated-files/lei2/"+TalendDate.formatDate("yyyyMMdd",TalendDa...()) +"/zip"
and If it's possible to create a variable that user can put the date?
Thanks
Share your tFileFtech settings.
If you want the user to enter the date when the job starts (that's it?), define a context variable (theDate for example) with datatype, tick the option "active prompt on variable" and enter a prompt value for the message.
Then change the expression by the following:
"https://leidata.gleif.org/api/v1/concatenated-files/lei2/" + context.theDate + "/zip"
Ok thanks, now I can put the date and download the file, the only things that I think I make wrong is the name of file to save.
I want to be named like the variable theDate.zip.
Thanks again
Great!
Thanks to mark your case as solved.
The only things that doesnt work is the name of the file, Is it possible to make it variable like theDate?
Thanks
solved:
""+context.theDate +".zip"
@mbocquetthis is not very fairplay to accept your own answer instead of the one from the guy whom had help you