SFTP Step: Copy Attachments to SFTP Server

kchorny
Tera Guru

Is anyone successfully using the SFTP action step to copy file attachments to a server? I am not sure what the 'Attachment records' field is expecting as input. It seems like it wants a sys_id, based on the error message, but it only seems to be grabbing a piece of the sys_id that I enter.

 

I have an input called Attachment that is type string, max 8000 chars. To test the action, I am entering the sys_id of a valid attachment (3a60c2eb1b2f2910fbbbeaccac4bcb25). Below is the error I'm getting. Why is the sys_id in the error message not the full sys_id that I entered?

 

[{"attachment_name":"","error":"Attachment does not exist or user does not have read permission on attachment with sysid 0fbbbeaccac4bcb2.","attachment_sys_id":"0fbbbeaccac4bcb2"}]

1 ACCEPTED SOLUTION

The array need to contain the attachment record itself. So you'd have a "Look Up Records" action in your flow with a condition of "Sys ID | is | <attachment sys_id>". Doing so will return an array with your attachment record. Then you have your SFTP action and can pass it the results of the "Look Up Records" action. There might be a better way to do it, but that's how I was able to work around it.

View solution in original post

5 REPLIES 5

Aylee Andersen
Kilo Sage

I built out a flow that uses the SFTP step to copy file attachments to a server. It took me a while but I got it working eventually.

 

One thing I noticed was that the 'Attachment records' is expecting a list of records, not just a single record. I had to add an action to my flow before my SFTP action to grab a list of records that returned an array containing my single attachment record.

 

I also ran into the same error message you did, but was able to resolve that by making sure my sys_user record that was associated to my MID Server had the right user roles to access the table that the attachment lived on. 

 

I hope some of that is helpful!

Thank you! Does the array contain the sys_id of the attachment, or the file name?

The array need to contain the attachment record itself. So you'd have a "Look Up Records" action in your flow with a condition of "Sys ID | is | <attachment sys_id>". Doing so will return an array with your attachment record. Then you have your SFTP action and can pass it the results of the "Look Up Records" action. There might be a better way to do it, but that's how I was able to work around it.

Thank you so much, it's working!!!