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

On change client script in reference Field

Shabbir1
Tera Contributor

Hello Team,

 

Is it possible to use on change client script on reference variable ..??

 

Requirement : If we select the country as UK in country variable (reference variable) in the category variable "autopay "option should  be hidden category is also a reference variable can anyone suggest how to achieve this without using/updating the reference qualifier is there any other solution..?

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@Shabbir1 

yes this is possible and you can add/remove options using OOTB g_form method

g_form.addOption(), g_form.removeOption()

reference qualifier won't work for drop down variable

what did you start with and where are you stuck?

💡 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

Hello  

 

As you have mentioned "reference qualifier won't work for drop down variable" its not a drop down both are reference variables 1.Country ( reference) 2.Category (reference) I guess add option remove option wont work on reference variables. Reference qualifier script is the solution i guess do we have any other solutions ..? can we achieve this without using the reference qualifier..?

ShabbirGhori_0-1789648058634.png

 

Hello @Ankur Bawiskar 

As you have mentioned "reference qualifier won't work for drop down variable" its not a drop down both are reference variables 1.country( reference) 2.Category( Reference) i guess add option and remove option wont work on the reference variable can you suggest me any other solution without updating reference qualifier script how can we achieve this is this possible..?