Ankur Bawiskar
Tera Patron
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-23-2025 04:22 AM
Often, there's a need to copy attachments from a record producer's attachment variable to the target record. Unfortunately, there's no direct out-of-the-box solution for this in ServiceNow.
However, you can achieve this by using the record producer script. Here's how you can do it:
// pass the attachment variable name
// pass the target table name associated with the record producer
new global.VariableUtil().copyAttachment(producer.<variableName>,'<tableName>', current.sys_id);
// repeat this line again for another variable if required
Output Comparison: Native and Portal
When running the script, here's the output you can expect in both the native and the portal:
- 1,044 Views
Comments
Scotty Williams
Tera Contributor
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
3 weeks ago
Howdy!
Do you know if there's a way to do this with attachments within a MRVS?
I tried the script logic below but no dice - any other magic you know of to make this possible?
Thanks!
Scotty
new global.VariableUtil().copyAttachment(producer.[mrvs_internal_name].[mrvs_variable_name], 'sn_customerservice_case', current.sys_id);