Attachment should be visible in incident form under manage attachment

Surekha Nalla
Giga Contributor

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

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@Surekha Nalla 

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! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Jorge Herrera2
Tera Contributor

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).

Jorge Herrera2
Tera Contributor

Important Considerations
System Properties: Check the property glide.ui.attachment_position. By default, it is often set to "bottom".

Ankur Bawiskar
Tera Patron

@Surekha Nalla 

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! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Tanushree Maiti
Kilo Patron

Hi @Surekha Nalla 

 

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 

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: