Attachment name and type validation before submitting catalog item form in service portal

Vignesh8
Tera Contributor

Hi Team, 

I would like to validate the attachment file name and type before submitting catalog form via service portal.

How can we achieve it ? Thanks in Advance.

25 REPLIES 25

Yash Agrawal1
Tera Guru

Hello Vignesh

If you attach anything in catalog item.automatically one record is created in sys_attachment table.

you can glide on that table and check the type and name of it....as service now provided diffrent colounm in that table to check type and name...

You can get a example of it in below link

https://community.servicenow.com/community?id=community_question&sys_id=a1bc5c47db9404540be6a345ca96...

 If you want help in scripting ,please keep posted

Regards

Yash Agrawal

Hi Yash, Thanks for your reply. Yes. We can glide on attachment table by passing element ID using gel function and we can restrict it before submission of form.i think this solution will work for backend view. Is there any other way to get element ID for new form in service portal ?

Hello vignesh,

Please go through the below link,you will find the code for portal as well.

https://community.servicenow.com/community?id=community_question&sys_id=311fa249db8fd38454250b55ca96...

Please keep posted ,if more help required

Regards

Yash agrawal

This Solution works for both Platform and Portal View, You can give it a try.