Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

OnChange client script for reference qualifier

Abhishek8
Tera Contributor

We have 3 variables in a Catalog Item

 

country -  Select box

business_application - Reference - cmdb_ci_business_app

service_offering - Reference - service_offering

 

Requirement is If we Select "India" in country variable 

then  business_application should list only below 2 option from table

LES/MES India
LES/MES India

 

and for service_offering ,it should list the below 2 options:

LES/MES Application for India
LES/MES Application for India

 

Similary if we Select country as Pakistan

Requirement is If we Select "India" in country variable 

then  business_application should list only below 2 option from table

LES/MES Pak
LES/MES Pak

 

and for service_offering ,it should list the below 2 options:

LES/MES Application for Pak
LES/MES Application for Pak

 

 

How to complete this requirement using Onlaod Client script

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Abhishek8 

it's an easy requirement with reference qualifier

something like this, please enhance with correct choice value etc

variable -> business_application 

javascript: var query; var val = current.variables.country ;
if(val == 'India')
query = 'nameINLES/MES India';
else if(val == 'Pakistan')
query = 'nameINLES/MES Pak';
query;

add something similar for the other variable

💡 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

@Abhishek8 

Hope you are doing good.

Did my reply answer your question?

💡 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