Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Validate CSV header fields when user uploads file to attachment variable.

Bindhu1
Tera Contributor

Hi Team,

I want to validate the .csv file header that is attached to the Attachment type catalog variable, this validation can be on change or while submitting. I want to check for specific header columns that must be present (eg., First name, Last name, email Id ). I tried this with below On change client script and script include but it is not working. Any suggestions would be appreciated.

Thanks in advance.

 

Client Script: (attached the word file with this script)

Bindhu1_0-1785238353497.png

Script Include:

Bindhu1_1-1785238514899.png

Catalog item:

Bindhu1_2-1785238825042.png

 

 

 

1 REPLY 1

Ankur Bawiskar
Tera Patron

@Bindhu1 

see below links should help and enhance your script, I shared solution on how to validate file when file is attached to attachment variable

Validate Excel Data and populate in MRVS 

Validations on MRVS - validate Employee ID 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader