- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 07:25 AM
Running Geneva version and we are fairly new to ServiceNow. We have a Service Request Catalog item for department moves. Along with the form users fill out, we need an Excel spreadsheet to be completed. Is there any way to somehow embed this attachment in the form and make it part of the form all the time, or have a link the user can click to get to the form? If this is possible, we are also trying to figure out a way to keep the user from submitting the request if the spreadsheet is not attached.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 07:58 AM
We handle making attachments available using this method:
- Attach file to the appropriate record
- Example: Document linked from a Catalog Item is attached the the item record (sc_cat_item)
- Save record
- Use the "view" link to open the attachment
- Obtain the attachment SysID from the end of the URL
- Create a URL link substituting this SysID:
- In a Rich Text field using this format:
sys_attachment.do?sys_id=43f614050a0a0b846fc33c7021c00455&view=true- Full HTML:
<a href="https://<your_instance>.service-now.com/sys_attachment.do?sys_id=43f614050a0a0b846fc33c7021c00455&view=true" target="_blank">My Link</a>
- Full HTML:
- Hyperlink in external document (include the instance):
https://<your_instance>.service-now.com/sys_attachment.do?sys_id=43f614050a0a0b846fc33c7021c00455&view=true
- In a Rich Text field using this format:
You can place the link in the item Description for the user to download, fill-out, save locally and attach before submission.
To require an attachment before submission see this onSubmit Client Script:
function onSubmit() {
var producer_id = gel('sysparm_item_guid').value;
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_name', 'incident');
gr.addQuery('table_sys_id', producer_id);
gr.query();
if (!gr.next()) {
alert("Message instruction the user to fill-out the attachment");
return false;
}
}
Please mark as Answers if this meets your requirements.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 07:29 AM
Hi Michael,
My recommendation is stick with the paperclip icon for consistency. If you start bringing attachment elements to the main form, it can be inconsistent and confusing. Use annotations if you need to provide users with additional instructions.
You might find the following helpful.
Make Attachment Mandatory - For A particular Catalog Item
Annotating Forms - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2016 07:58 AM
We handle making attachments available using this method:
- Attach file to the appropriate record
- Example: Document linked from a Catalog Item is attached the the item record (sc_cat_item)
- Save record
- Use the "view" link to open the attachment
- Obtain the attachment SysID from the end of the URL
- Create a URL link substituting this SysID:
- In a Rich Text field using this format:
sys_attachment.do?sys_id=43f614050a0a0b846fc33c7021c00455&view=true- Full HTML:
<a href="https://<your_instance>.service-now.com/sys_attachment.do?sys_id=43f614050a0a0b846fc33c7021c00455&view=true" target="_blank">My Link</a>
- Full HTML:
- Hyperlink in external document (include the instance):
https://<your_instance>.service-now.com/sys_attachment.do?sys_id=43f614050a0a0b846fc33c7021c00455&view=true
- In a Rich Text field using this format:
You can place the link in the item Description for the user to download, fill-out, save locally and attach before submission.
To require an attachment before submission see this onSubmit Client Script:
function onSubmit() {
var producer_id = gel('sysparm_item_guid').value;
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_name', 'incident');
gr.addQuery('table_sys_id', producer_id);
gr.query();
if (!gr.next()) {
alert("Message instruction the user to fill-out the attachment");
return false;
}
}
Please mark as Answers if this meets your requirements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 12:32 PM
Thanks Robert. We did stumble on the script and we were able to figure out how to attach an Excel doc to the Service Request form. Thanks for that info. Our next challenge is to make it easy for users to attach the Excel doc to the form. There is no attachment icon on the form in the ESS portal so we searched and found a Catalog Client Script that puts an attachment link in the upper left corner of the form. Users can click this and attach their Excel doc.
Problem now is the formatting of the link is not correct. The bottom of the text is getting clipped. I posted this in Text getting clipped at bottom on Service Catalog page
Maybe you have a suggestion for this also. I have played with the code and settings with no success. It looks worse in IE then it does in Chrome. It's usable, it just does not look good.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2016 01:18 PM
Did you try changing the height style in that code?
You can also try a macro variable "portal_attachment_entry". I think it's OOB but I attached it.
We place this in a variable set to relate to items and record producers to appear at the bottom of the forms. You can add a label to give further instruction.