Solved

FTPCaller URL and Target FIle name more dynamic

  • 8 November 2022
  • 2 replies
  • 5 views

Badge +1

Currently we hardcoded the ‘URL’ & ‘Target File’ attributes in our FTPCaller parameters:

FTPCaller2Is there a way to specific them in a more dynamic way?

For example, ‘Operating Account Structure - Export Budget 2022-09-22_13_27_55_PDT.csv’, the '‘Operating Account Structure - Export Budget ' part is static and '2022-09-22_13_27_55_PDT' part is dynamic date/time. How can we specific the dynamic part with wildcard something like ‘Operating Account Structure - Export Budget%.csv'? Thanks.

 

icon

Best answer by caracadrian 8 November 2022, 07:04

View original

2 replies

Badge +20

You should first list the contents of the FTP folder, sort the results, filter for just the file/files you need and input the filename into a second FTPCaller.

FTP list files and downloadTo extract the filename from the FTP response you can use a series of AttributeSplitter with Delimiter Newline (\\n - LF), ListExploder, AttributeSplitter with Delimiter Space ( ) and ListIndexer with List Index To Copy -1 (last element). Figure something else if your filenames contain spaces. Concatenate the extracted filename with the original URI in the second FTPCaller.

Badge +1

Thanks @caracadrian​ this is very helpful!

Reply