- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi,
There is a record producer which have attachment as a variable when user submits the request the attachment is not showing at the top of the ticket instead it is showing only on variable tab.
Our requirement is the attachment should be visible on the top of the ticket as shown below.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
OOTB the file from attachment variable won't get copied to target record
you can use this in record producer script, I created blog for this
new global.VariableUtil().copyAttachment(producer.<variableName>,'<tableName>', current.sys_id);
Copying Attachments from a Record Producer's Attachment Variable to a Target Record in ServiceNow
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
If you are using SP you can try:
1.- Navigate to your Record Producer.
2.- Under the Variables related list, click New.
3.- Set the Type to Attachment.
4.- Give it a Question/Name (e.g., "Upload your documents here").
5.- Use the Order field to give it a low number (e.g., 10 or 100).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Important Considerations
System Properties: Check the property glide.ui.attachment_position. By default, it is often set to "bottom".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
OOTB the file from attachment variable won't get copied to target record
you can use this in record producer script, I created blog for this
new global.VariableUtil().copyAttachment(producer.<variableName>,'<tableName>', current.sys_id);
Copying Attachments from a Record Producer's Attachment Variable to a Target Record in ServiceNow
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
43m ago - last edited 42m ago
As per KB2657281 Attachment Type Variable Does Not Add Files to Target Record in Record Producer
When using an Attachment Type variable in a Record Producer, files uploaded through this variable are not being added to the target record after submission. Instead, the attachments remain associated with the submission record, not the generated record.
Cause
This is the default platform behavior: attachments uploaded via an Attachment Type variable in a Record Producer are not automatically copied to the target record. By design, these files are linked to the submission record, and additional configuration is required to transfer them to the generated record.
Resolution
1. Recognize that out-of-the-box, attachments from Attachment Type variables in Record Producers do not transfer to the target record.
2. Use a script or business rule to copy attachments from the submission record to the target record after the record is created.
For sample code of BR , refer : Usage of "Attachment" variable for Incident Record Producers
