How to auto-populate a field in catalog form with data from custom table?

MandyMaseyM
Giga Contributor

Hi ServiceNow folks, I'm currently an intern and fresh from a 2 week bootcamp.

 

I'm currently creating a new catalog form and I need help with my tasks.

 

Can someone please help me on how to auto-populate a field in catalog form with data from custom table?

We created this custom table called Medical Equipment. 

 

ME1.jpg

And the catalog for I'm creating consist of 4 fields. We need the DEPARTMENT field to auto-populate based on the data from the custom table. 

 

Example:
ME2.jpg
Please take note that the catalog form is data-driven because the data from the custom table can change so even if the data changes, the solution we need cannot be hard-coded. Can someone please help me? Thanks!

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@MandyMaseyM 

Assuming your 1st variable is reference to that custom table, you can achieve this without scripting using auto populate Utah feature

Auto-populate a variable based on a reference type variable (Utah) 

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

Shubhras
Tera Contributor

Method 1: You can autopopulate these variables based on variable autopopulate feature which is available for each and every variable. 

Method 2: Create an  "onChange" Catalog Client Script.

Catalog Client Script + Script Include → If the value is fetched dynamically from a table.