Send a CSV file using SFTP in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2022 09:44 AM
My requirement is to send a csv file to external location using SFTP.
I'm using custom action on flow designer, I built a two step action. First step would be generating a csv file(calling a script include using run script action) and then taking the output in "string" format and sending it in the next step which is SFTP step. However, I'm unable to get this working.
Is string format correct for sending the csv file via SFTP? If i choose the output type as "file attachment" on script step, its not allowing me to select as input on SFTP step. The script works when I try to generate the csv file and attach it to a record within servicenow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2022 09:30 PM
"String" is not a good way to achive this, because it has length limit.
Follow the below doc to copy Attachments To SFTP Server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2022 12:16 PM
In this case, I need to send the attachment which is an export of all records on a table. should this attachment be stored somewhere in servicenow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2022 05:17 PM
I‘am not sure if this is a best practice.
You can create a csv file with all records on the table ,and puto the csv file into the attachment table ,and then send it to SFTP.