Validate XML file attachment

Vutikonda Vinay
Tera Contributor

Hello,

 

We have a requirement to create catalog item that contains attachment should only accepts XML files with contains data only.

 

We created catalog item variable then added attribute that allows XML file however when we try to submit blank XML file it accepts.  

 

Can anyone have idea on how to validate blank XML file attachment? 

 

Thank you

1 REPLY 1

Mohammed Al-Mar
Tera Guru

You can utilize the out-of-the-box attachments feature in ServiceNow. Then, when the user submits the form, you can use an onsubmit client script to verify that the uploaded attachments are XML files by checking their names. Additionally, ServiceNow's out-of-the-box functionality already prevents empty file uploads.

MohammedAlMar_0-1728917234784.png