- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 04:15 AM
Client is placing file on SFTP server everyday with filename appending with date and time. Ex: name-2023-03-14-15-03-52.csv.
I tried the filename using wild card character like "name-2023-03-14*.csv" but its not working. Is there a way to get the file having timestamp appended at the end?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 12:31 AM
Below are the steps:
In the SFTP step available OOB (requires Integration Hub subscription), using Get File List command we can pass source path and get the file names present in that folder. This command also accept filenames with wild card character to get specific files. In our case, filename appends with timestamp at the end. So we passed filename as “<filename>_*.csv” and retrieved complete filename shown below.
Output:
Using script, we can read the filename and pass it over to the SFTP data source which pulls data from the server.
Other commands like Copy Files To This Instance are also available which will reduce multiple SFTP calls to the server.
PS: To make this work, you should allow connection between mid server and SFTP server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 04:24 AM
@Ravindra Kaja - This requirement is already discussed in another post. Please refer to the link below,
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 04:29 AM
In that post, it was discussed only about date part. I can append date part but here client is appending timestamp also. As we cant append timestamp, checking the possible ways how to pass the filename.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 04:38 AM
you can make it work only when client doesn't add time.
with only current date you can achieve.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2023 04:50 AM
Ok. Is there a way to get the filename from the sftp server folder and pass that into the data source?