Copy Attachment from Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 12:03 PM
Hello Experts,
For a catalog item I have built a Flow and I am creating a 'contract' record as part of that flow. But, I want to copy attachment from RITM to contract record that is created.
Going through community posts, I have used 'Look Up Attachment' and 'Look up attachment records' and 'copy attachment' below are three screenshots, But what should I select as 'source attachment record' in my last screenshot?
How can this be achieved?
Thanks,
Ben.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 12:47 PM
Hi,
For copy attachment please use the action “Copy Attachment” In flow
Step1:
Trigger condition
Trigger is “Created”
table is sys_attachment
in condition, table name is “sc_req_item”
and put the catalog item name if you want to run this flow for specific catalog.
Step2:
Add actions “Copy Attachment”
source attachment is drag the RITM record using pills from step 1
target record using the script:
var gr = new GlideRecord("contrac table");
gr.addEncodedQuery('parent='+ fd data.trigger.current.table_sys_id)// add the correct relationship parameter
gr.query () ;
if (gr.next ()){
return gr.sys id;
}
Target table is your contract table.
Please try this and let me know.