We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Autopopulate categoryowner depends upon category and subcategory

sibasundarsahoo
Tera Contributor
 
8 REPLIES 8

Gangadhar Ravi
Giga Sage

@sibasundarsahoo Replace this.getParameter() with gs.getProperty() or use gs.getRequest().getParameter(). The u_category and u_sub_category variables are undefined in the script.

 

var category = gs.getRequest().getParameter('u_category');
var subcategory = gs.getRequest().getParameter('u_sub_category');

Please mark my answer correct and helpful if this works for you.

 

is my script is okay?

 

Ankur Bawiskar
Tera Patron

@sibasundarsahoo 

update as this

ga.addParam('sysparm_u_category', category);
ga.addParam('sysparm_u_sub_category', subCategory);

Script include

var category = this.getParameter('sysparm_u_category');
var subcategory = this.getParameter('sysparm_u_sub_category');

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

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

its not working, can u pls help me how to do this?