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.

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
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  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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