Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

1 ACCEPTED SOLUTION

@Dipali_Pawar 

Hope you are doing good.

Did my reply answer your question?

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

View solution in original post

21 REPLIES 21

thippeswamy
Kilo Contributor

You are populating data on the MRVS based on the attachment variable.

  • For rows that pass validation, add them into the MRVS.

  • For rows that fail validation, display an info message to the user indicating which Excel row failed and why, so they can correct it.

If my response helped, please mark it as correct and close the thread so it can benefit future readers.

 

Regards,
Swamy

Ravi Gaurav
Giga Sage
Giga Sage

Hi @Dipali_Pawar 

If you’re parsing Excel with a Script Include + GlideAjax and populating the MRVS rows, you can run validation before inserting into MRVS.

After parsing each Excel row, run a RegEx test on each column value.

If invalid, don’t push it into MRVS → instead, return an error to the user.

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/