SFTP - CSV Import - Need Most Recent File

  • 171Views
  • Last Post 16 August 2019
0
votes
Michael Farah posted this 23 July 2019

I am trying to grab a CSV from an SFTP and import it into Salesforce.

 

I need it to grab the most recent file currently the CSV is being dropped every 4 hours. Does the taks grab the most recent file or on the file that you set it to? Is there any work arounds if it does not grab the most recent file?

Order By: Standard | Newest | Votes
0
votes
Mariia Zaharova posted this 23 July 2019

Hi Michael!

 

As I can see you are using file with the name like this one "GardenStateLoans_20190722174501.csv". 

In this case, Skyvia will catch only this file. Currently, Skyvia does not have the Most Recent option, however, we recommend you to look at the File Mask option.

 

Please note, it's not recommended to use seconds or fractions of seconds, and even minutes in the mask, since it's not guaranteed that package will run in exactly the specified time. When Skyvia is under peak load, package run may be delayed for a few seconds. And even if the difference of the package run time and the date/time in the file name is minor, the package run will fail.

Thus, according to your scenario (run package several times a day) we recommend you to have files with the name like  "GardenStateLoans_2019072217.csv" and use File Mask like GardenStateLoans_{yyyyMMddhh}.csv.

 

Feel free to ask any further questions.

 

Best regards,

Mariia

0
votes
Michael Farah posted this 13 August 2019

Hi Mariia,

I did the following and I am now recieivng the following file, but everytime I do a file mask it says that the CSV does not exist?

Can you please help me with this problem?

 

Thanks,

 

Michael 

0
votes
Dmitriy Muzurov posted this 14 August 2019

Hi Michael,

Thank you for getting back to us.

A file specified in the package editor of your package is not a mask but have a definite name - GardenStateLoans_20190813134502.csv

If you wish to catch a file with the date August 13, 2019 and time 13PM, the file name in the package editor should have the following mask: GardenStateLoans_{yyyyMMddHH}.csv. Also, make sure the correct timezone is specified.

We would strongly not recommend using minutes and seconds in the mask, since it's not guaranteed that package will run in exactly the specified time. When Skyvia is under peak load, package run may be delayed for a few seconds or even minutes. And even if the difference of the package run time and the date/time in the file name is minor, the package run will fail.

Please find more details about file masks here.

Should you have any questions, do not hesitate to contact us back.

0
votes
Michael Farah posted this 14 August 2019

Perfect thank you!

 

Is it possible to auto delete a file after processing it so we don't see a back log of files?

 

Thanks!

0
votes
Dmitriy Muzurov posted this 15 August 2019

Dear Michael,

You are welcome.

Skyvia does not have such functionality for now.

We are looking forward to hearing from you, should you require any further assistance.

0
votes
Michael Farah posted this 15 August 2019

Hi Dmitriy,

Can you take a look at my scheduled and see how to configure if I’m trying to sync files at 6:05 AM, 10:05AM, 2:05 PM, and 6:05PM. Right now it’s only getting one time per day.

Thanks!

0
votes
Dmitriy Muzurov posted this 16 August 2019

Dear Michael,

Thank you for your reply.

Skyvia tries to find a file with a date and hours in its name. Make sure to use 24-hour format for file names.

You need to put a file with the correct name that corresponds to a scheduled run before 6:05, 10:05, 14:05 and 18:05.

The correct schedule for your use case is the following:

 

Should you have any questions, do not hesitate to contact us back.

Close