Create a client script to add attachment in requested item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2023 08:15 AM
Created a variable named attachment for catalog item ,
The requirement is
when submit the form the attachment should create a record in "sys_attachment" table with
table_sys_id as sys_id of the current requested item, and table name as 'sc_req_item' .
Implement it through a simple onSubmit catalog client script in servicenow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2023 08:22 AM - edited ‎06-19-2023 08:22 AM
Hi there,
How is this different than adding an attachment directly through a Catalog Item? Or an attachment through a variable of type attachment?
Why would you need a client script for this?
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2023 08:29 AM
Adding an attachment directly through catalog item is possible but, as per my requirement the attachment field is mandatory and the default attachment is not showing in the related information widget in service portal, but the variable attachment is showing in related information. Help me with a catalog client script for the requirement.
Kind regards,
Faiz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2023 08:34 AM
So you could also use the Mandatory attachment checkbox on the Catalog Item then?
Or I'm just not understanding your question.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2023 08:49 AM - edited ‎06-19-2023 08:50 AM
I need to show the attachment in related information widget in service portal when it is empty like other variables but, it is not possible with the default attachment, so i created a variable for attachment.
Kind regards,
Faiz