- 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
08-01-2025 10:15 AM
Hi @Ankur Bawiskar @Ravindra Kaja @Chuck Tomasi @Jeff Hausman @Ravi Gaurav ,
I want to Fetch a file name from an SFTP server and dynamically update a Data Source file path in ServiceNow Flow Designer
Step 1 - inputs
Step 2 - SFTP STEP
STEP 3 - SCRIPT STEP
STEP 4 - OUTPUT
@Ravindra Kaja can you please the whole screenshots of your steps as I'm getting empty output .
Please help me to get the filename through sftp and do share your whole screenshots.