- 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 11:02 PM
you are having a variable on your catalog item or a dictionary field on RITM table?
you told you are using flow so I already shared links for that
If you want to do this via BR then do this
1) after insert BR on sc_req_item
Condition: current.cat_item.name == 'Your Catalog Item Name Here'
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 11:06 PM
@Ankur Bawiskar script will be same as i shared?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 11:40 PM
you didn't answer my question
you are having a variable on your catalog item or a dictionary field on RITM table?
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 11:43 PM - edited 07-17-2023 11:44 PM
I am having a variable field work order task and its pointing to work order task table which is reference field and i want to copy attachment on that table only @Ankur Bawiskar . As u mentioned create after insert br on sc_req_item what will be the script??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 12:00 AM
Sorry I think you are confused.
What do you mean by having a variable field?
is it a reference variable or is it a reference field?
If it's a reference field on RITM then how is it getting populated? without knowing this you cannot know which Work order task you should copy the file
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader