Validation of attachment in a catalog Item

Bijay Kumar Sha
Giga Guru

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

5 REPLIES 5

Anurag Tripathi
Mega Patron
Mega Patron

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. 

 

-Anurag

SN_Learn
Kilo Patron
Kilo Patron

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.

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..