Upload a file from MidServer to an SFTP site

Tom71
Tera Contributor

I have daily export from ServiceNow instance using export set to MidServer folder. My use case is to export this file from the MidServer to another third party SFTP site. Any help is highly appreciated?

 

I tried using the following posts using JavascriptProbe but its not working

https://www.servicenow.com/community/developer-forum/push-csv-file-from-mid-server-to-an-sftp-locati...

https://www.servicenow.com/community/now-platform-forum/send-attachment-to-sftp-location/m-p/1214918

1 REPLY 1

Deepak Shaerma
Kilo Sage

Hi @Tom71 
1. Export Set Configuration: Configure an Export Set in ServiceNow to generate the file you need. You’ve mentioned this is already set up to save files to a Mid Server folder.

2. Flow Designer: Utilize the ServiceNow Flow Designer to create a flow that triggers on a schedule (daily, as per your requirement).

3. Script Step: In the flow, add a Script step or an Action step that involves executing scripts or commands on the Mid Server. This script should be responsible for transferring the file from the Mid Server’s folder to the target SFTP site. You will need to write a script that uses either SCP (Secure Copy Protocol) or SFTP (SSH File Transfer Protocol) to accomplish this. The exact script will depend on your server’s environment (Linux/Windows) and the destination SFTP server requirements.

4. Security Considerations: Ensure that the ServiceNow Mid Server has the necessary permissions to execute SCP/SFTP commands and that it can authenticate with the third-party SFTP server. This might involve setting up SSH keys or having a secure method of storing and retrieving passwords.
Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning ‌‌
Thanks & Regards 
Deepak Sharma