Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Custom Attachment field is not working as expected.

BiswajitD
Tera Contributor

When a file is uploaded in a custom attachment field and the record producer is submitted, an HR case is created. However, the attachments are not visible in both the backend view and the frontend view of the HR case.

 

  • A Record Producer is being used
  • Table: sn_hr_core_case_operation
  • Attachment is uploaded successfully during submission
  • But no attachment appears on the created HR case

Could you please suggest why the attachments are not being populated on the HR case and how to resolve this?

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@BiswajitD 

attachments added on Attachment type variable is not copied to target record OOTB

you need custom script for that

see my blog on how it can be done

Copying Attachments from a Record Producer's Attachment Variable to a Target Record in ServiceNow 

in record producer script add this line

new global.VariableUtil().copyAttachment(producer.<variableName>,'<tableName>', current.sys_id);

💡 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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader