Validation after Excel upload

Dipali_Pawar
Tera Contributor

Hi, I have requirement to populate data on MRVS via excel upload that is working. but validation part I need to do suppose i have fields x , y and in MRVS x has regex which accept 9 digits and y has regex 2 decimal places so same validation should take place after uploading excel. 

suppose user enters only 3 digits in x column in excel then after uploading it should show error like please enter up to 9 digits. 

please let me know if anyone worked on similar requirement. 

Thanks

20 REPLIES 20

@Dipali_Pawar 

that's not possible.

You are auto-populating the MRVS with the rows which are valid.

OR

You can populate every row whether it's valid or not and then use onLoad catalog client script which applies to MRVS and shows field message near those 2 variables if validation fails.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

But on same time it should validate that's why I have written on change script, how to achieve both the things. and in previous code only alert message i am getting but auto population is not happening

 

@Dipali_Pawar 

Validation i.e. onChange will work when you open the MRVS row and user enters the value in variable.

In your case you are auto-populating then onChange won't trigger as you are not opening MRVS modal row.

I suggest to use this approach

1) auto populate rows irrespective of valid or invalid

2) then run onLoad catalog client script on MRVS and show error message near variable if validation fails

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar , in on load script not getting alert itself need to achieve this via on change only 

Hi @Shashank_Jain , alert I am getting correctly but data is not auto populating please suggest me what to do