- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 05:59 AM
Hi All,
I have a requirement where I have to measure the size of the attachment while submitting the catalog item.
The attachment should not be more than 10 KB. If it is more than 10 KB then it should throw an alert and abort the action. Hence user will not be able to submit the catalog item with that file.
or, is there any way to check the number of rows in the CSV file up to 20 records? If there is more than 20 records it will abort the action and user wont be able to submit the cat item.
Kindly help how to achieve this requirement.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 10:32 PM
you should use Attachment type variable with this variable attribute
Also check this link for onchange client script to validate the rows, you will have to enhance it by using CSV Parser
Validating an attachment variable
Check docs for more help
Types of service catalog variables
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
04-15-2025 10:25 PM
Hi @Ankur Bawiskar , do you have any suggestions how to proceed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 10:32 PM
you should use Attachment type variable with this variable attribute
Also check this link for onchange client script to validate the rows, you will have to enhance it by using CSV Parser
Validating an attachment variable
Check docs for more help
Types of service catalog variables
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
04-15-2025 10:38 PM
Hi @Ankur Bawiskar ,
Is it not possible to check with the OOB attachment icon that is present?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 10:54 PM
it's challenging as the record in sys_attachment gets created each time with different cart sysId which we don't know how is generated
So I will suggest to use attachment type variable and use the OOTB variable attributes and no scripting will be required
I believe I have answered your question
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