- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 10:43 PM - edited 07-17-2023 10:44 PM
Hi I have a requirement where I have to copy attachment from catalog item to a particular table. We have a reference field for that table in the catalog item. @Ankur Bawiskar please help me in this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 12:32 AM
this should work fine
1) after insert BR on sc_req_item
Condition: current.cat_item.name == 'Your Catalog Item Name Here'
Script:
Note: Ensure you give correct variable name of your variable which refers wm_task table
GlideSysAttachment.copy('sc_req_item', current.sys_id, current.variables.variableName.sys_class_name, current.variables.variableName);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 10:46 PM
so in catalog item you have a reference variable and you want to copy file to that record i.e. the file which gets attached to RITM during submission?
if yes then you can use workflow run script for this if you are using workflow
GlideSysAttachment.copy('sc_req_item', current.sys_id, current.variables.variableName.sys_class_name, current.variables.variableName);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 10:50 PM
Hii @Ankur Bawiskar thanks for quick reply yes we have refernce field which is pointing to that table and i want to copy attachment to that table we are using flow designer not workflow for this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 10:55 PM
then you can use flow action Copy attachment
check this link has approach
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0813220
also this link
Unable to copy attachments using flow designer
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 10:59 PM
Hi @Ankur Bawiskar i am using after insert business rule on the target table and this is the query which is not working