File retrieval using SFTP data source

charanpreet
Kilo Expert

I have configured Data source using SFTP file retrieval method.

The file that will be kept in the path can be of any name which is not known before and there can be more than one file.

What should be specified in the 'File Path' and 'Connection URL'?

1 ACCEPTED SOLUTION

The issue is that the pattern of the file name is not known.


So the solution is that we can have Inbound action and in this way the user can send an email with the file attached to the ServiceNow. The inbound action will invoke the data source to load the data from the attachment in the mail.


View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Charanpreet,



The file name should be constant there in the: Another way to make it dynamic would be that you must be sure what file name it will be the next day if the data load is working every day.



Approach:


1) Have data source with some file path example: /files/incident_2017-08-04.csv


2) This data load will run automatically using scheduled data import.


3) Just before the scheduled data import runs have schedule job to update this file path to next file i.e



pick the filepath and rename it i.e. next day when job runs the date would be 2017-08-05 so new file path would be /files/incident_2017-08-05.csv.



But you need to be sure that "incident_2017-08-05.csv" file is present in that directory on the next day then only this approach will work.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

The file name cannot be assumed before the file upload, it can be any file name.


So updating the file path with new file name is not possible.


Hi Charanpreet,



Then I don't think as of now any solution exists for this.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Charanpreet,



Any update on this?


Can you mark my answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.



Regards


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader