Validation of attachment in a catalog Item

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 02:11 AM - edited 07-22-2024 02:12 AM
Hi,
I've one catalog item and there is a variable with type as Attachment where user will upload an excel sheet.
How I can put a validation that the catalog item only accept excel sheet. Also, there should be a specific format. attached is a sample template. It should accept that only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 02:19 AM
Hi,
You can validate if there is an attachment or not, You can also validate the name or format maybe but validating the content is really out of scope for ServiceNow and there is no oob way to do it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 02:21 AM - edited 07-22-2024 02:21 AM
Hello @Bijay Kumar Sha
Below links should be helpful -
If my answer solves your issue, please mark it as Accepted✔️ and Helpful👍!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 02:27 AM
Hi @Bijay Kumar Sha ,
Please check the below:
Attachment Validation or Record Producer/Catalog Item
In the variable, add the below in the variable attribute:
allowed_extensions=xlsx
If more file need to be added in future, then it will be like:
allowed_extensions=xlsx;pdf;pptx
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 06:44 AM
Hi @SN_Learn ,
It worked when I mentioned 'allowed_extensions=xlsx' in variable attribute in the attachment variable... By this I can validate the attachment file format.
Now, How I can validate the name of the attachment. The name should be Bulk Upload Template.xlsx. It should not accept any other name..