Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How to Validate Employee Details from an Uploaded Excel & Create Multiple Catalog Requests Automatic

NeethuB
Tera Contributor

I have a requirement where I will create Catalog Item A. The user will upload an Excel file containing Employee ID and Employee Name.

After the Excel is uploaded, I need to:

  1. Read the employee details from the uploaded Excel.
  2. Validate each Employee ID against the sys_user table.
  3. If the Employee ID exists in sys_user, get the corresponding user record/sys_id.
  4. Based on the validated employees, automatically create separate RITMs for each employee for another existing catalog item, Catalog Item B.

For example, if the Excel contains 5 employees, I need to validate all 5 employees against sys_user and, if valid, create 5 separate RITMs for Catalog Item B, one for each employee.

I would like to understand the recommended ServiceNow approach for this requirement:

  • How can I read and validate an Excel uploaded through a Catalog Item against the sys_user table?
  • What is the recommended approach—Flow Designer, Script Include, or another method?
  • How can I programmatically create multiple RITMs for Catalog Item B, one RITM for each validated employee?
  • Is there a recommended/best-practice API or method for creating these RITMs and passing the employee information into Catalog Item B?

Any guidance or examples of the recommended approach would be greatly appreciated.

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@NeethuB 

you can add attachment type variable and user will add file to it

Then use Flow and custom flow action to handle all the validation and either use CartJS via script to raise new RITM and REQ OR use "Submit Catalog Item" flow action to raise new REQ

💡 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

Thanks for the guidance.

I am already getting the Excel file attached to the RITM using the OOB Attachment variable in Catalog Item A.

My question is: How can I read/use the Excel file data and get the employee ID and employee name values within Flow Designer?

Once I have the Excel data in the Flow, I need to validate each employee ID against sys_user and then create a separate RITM for Catalog Item B for each valid employee.

@NeethuB 

use GlideExcelParser API

GlideExcelParser - Scoped, Global 

also check below links

Solved: How to populate Manager field(reference type) and ... - ServiceNow Community

How to read the data from attached Excel file and ... - Page 2 - ServiceNow Community

💡 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