Article : Copy Attachments from Source to Target Record using Flow Designer

Badal Khojare
Mega Sage
Mega Sage

 

I have mentioned details of the issue I faced and then steps taken to resolve them in the attached document.

Copy Attachments from Source to Target Record using Flow Designe

 

  1. With Copy Attachment Action, when I used source record table in Source Attachment Record field it gave me below error:

 

 

 

 

 

This is controlled by a Script Include ‘AttachmentActionErrorHandler’, that says Source Record must be  Attachment table. So in my Flow I changed it to sys_attachment. This is not directly possible as there is no attachment table reference in flow earlier. So, I added a Lookup Action on attachment table and then used the reference in next step.

 

 

 

  1. Now my Flow got executed without error as seen below but the attachment that I was getting on my Change Record was not the one I attached on my RITM.

 

 

 

 

  1. So I checked the Execution details, and in the Get Attachments on Record Action I got the correct attachment from source.

 

 

 

In the next Action, Lookup Record, I was getting a different attachment

 

 

 

 

 

 

 

 

 

  1. And the same attachment was getting copied to the target record.

 

 

 

 

 

 

 

  1. This was because in the Lookup Attachment Record, it returns the first record it finds based on the given condition.

 

 

 

  1. So I added few conditions to the Lookup Attachment Record Action
 

 

  1. Now it takes the Source attachment from the RITM and copies it to my Target record, as shown below.

      

 

 

 

 

 

  1. As of now the attachment is attached from a variable so it only takes one attachment, but if there are multiple attachments to be copied I have added ‘For Each’ Flow so it takes all the attachments and copies it to target record.

 

 
  •  
Please Mark My Response as Correct/Helpful if it helped.
Regards,
Badal Khojare
Community Rising Star 2023
1 REPLY 1

Sairam3697
Tera Contributor

Can you please share the complete flow ?