- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 09:02 AM
I understand that this is how it functions out of the box, but I have an attachment field on one of my record producers. Whenever someone uploads an attachment through the field, it places the attachment in the body of the record producer. I also noticed that the table name has "zz_yy" attached at the beginning. Is there any configuration I can implement to ensure the image is placed in the header instead of the body of the case?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2025 09:20 AM
yes this is OOTB but you can use custom solution.
use this link where I shared solution on how to copy the attachment present in attachment variable to the target record so that it appears in header.
Disable ZZ_YY prefix from attachment when added through record producer
Sharing the script here
1) I created Async After Insert BR on the target table of record producer
2) Script as this
a) Remove the ZZ_YY
b) Then use the Copy Attachment
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_name", "ZZ_YY" + current.getTableName());
gr.addQuery("table_sys_id", current.sys_id);
gr.query();
if (gr.next()) {
gr.table_name = current.getTableName();
gr.update();
new global.VariableUtil().copyAttachment(gr.sys_id, current.getTableName(), current.sys_id);
}
})(current, previous);
Output:
1) The file added to the record
2) The file present on the attachment variable
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
‎05-12-2025 10:59 AM
Hi Ankur,
The BR did not work! I tested and the image still populates in the body of the case: