- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 10:13 PM
Hello!
I have managed to copy the attachment to the send email action but in the case when there is more than one attachment on the RITM the flow only copies the first attachment.
Is there a way to copy all the attachments?
I tried to use the For each item in the attachment list action to look up the attachment list and copy the attachments but I only receive the first attachment duplicated X times.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 02:34 AM
Okay I see.
In the Look Up Attachment step, You're using the output Attachment Sys ID which only store the sys_id of the first attachment.
The output should be used is the Attachment List one, it's an array contains elements as object type. So it might be difficult to work this out.
Let's try the simple approach below with just one query, use the Look Up Records instead.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 01:15 AM
Hey @Stergios Stergi
You're using the Look Up Record action. Let's replace by the Look Up Records one. 😋
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 11:13 PM
Hey @Stergios Stergi
We don't need to loop through each attachment to do the copy, just put the param for the Source ID as the RITM record, the the Target ID is the Email record.
Ref the API below.
GlideSysAttachment()
var attachment = new GlideSysAttachment();
var ritmID = '70bccc72472e7990ab9bb6bf016d434e'; //RITM0010017
var copiedAttachments = attachment.copy('sc_req_item', ritmID, 'sys_email', 'f4cc40b2472e7990ab9bb6bf016d4395');
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 01:19 AM
Hello @Tai Vu nd thanx for the reply!
If understand correctly, the solution you proposed includes some coding.
Since my coding game is a bit weak, is there a no code solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 01:49 AM
If the notification is being triggered for the record from which the attachments originate, you can attempt this method by activating the "Include attachments" checkbox in the "What it will contain" section of the notification.
Include attachments | Select this check box to send all attachments from the triggering record as email attachments. |
Or let double-check your Look Up step, it seems not giving the correct result for the Copy Attachment step.
I can see you perform 2 Look Up at the step 12 and 13, is it something expected?
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 02:13 AM
The section of the flow starts with the Look up Attachment where i pick up the attachment's SysID:
Then I use the Look up Attachment Record to filter the sys_attachment table with the sysID I picked up.
Lastly, I copy the attachment to the send email action from the source record of the previous action
The above flow works as I mentioned. But I only receive the first attachment posted on the form.
Is there a different way?