cancel
Showing results for 
Search instead for 
Did you mean: 

Using a File Poller to a File Reader

FalleurJ
New Contributor

Hello,

I am trying to figure out how to use a File Poller to make a file name a variable and then to use that variable as the file to use in a File Reader? I am not sure on how to get it to work. Also, how does the File Poller truly work if I have multiple files with the same name, but different timestamps, does it go through them 1 by 1? or all 3 at the same time for example? I using a file that is on an FTP server, and is dynamic with a time stamp, and there could be multiple files but with different timestamps.

9 REPLIES 9

If you validate the Pipeline - File Poller Snap should return the o/p. Something like this

o/p

“path”: “ftp://XX.XX.XX.XX/HousingPhotos1_FullFeed.zip”
“path”: “ftp://XX.XX.XX.XX/HousingPhotos1_FullFeed.zip”
“path”: “ftp://XX.XX.XX.XX/HousingPhotos1_FullFeed.zip”

The in the File Reader Snap - File* Just pass $path.

Hi Falleur,

I would suggest use directory browser over file poller if integration type is scheduled. Once you read file from directory browser you can found the path variable as a output , you can use it on file reader.

Can you please show me an example of what you mean?

FalleurJ
New Contributor

Okay I have that working correctly, one last question how do you get a timestamp to be populated on the end of a file?

File Writer Snap - File property* ‘sample’+Date.now().toLocaleDateTimeString({“format”:“yyyy-MM-dd HH:mm”})+‘.json’

For Reference.

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439344/Date+Functions+and+Properties