Article : Copy Attachments from Source to Target Record using Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 09:06 AM
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
- 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.
- 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.
- 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
- And the same attachment was getting copied to the target record.
- This was because in the Lookup Attachment Record, it returns the first record it finds based on the given condition.
- So I added few conditions to the Lookup Attachment Record Action
- Now it takes the Source attachment from the RITM and copies it to my Target record, as shown below.
- 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.
Regards,
Badal Khojare
Community Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 08:43 AM
Can you please share the complete flow ?