Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Dynamic choices in multiple choice variable type

Brijmohan
Tera Contributor

Hi, is there any way to set dynamic choice in multiple choice variable type. I have tried below client script that is working for select box type but not for multiple choice type. 

function onLoad() {

    var userEmail = g_user.email;

    var splitEmail = userEmail.split('@');
    var userName = splitEmail[0];
    var domain = splitEmail[1];

    var newEmail = userName + '1@' + domain;

	var label1 = "No thanks. I will keep " + userEmail;
	
    g_form.removeOption('v_email_address', 'keep');
    g_form.addOption('v_email_address', 'keep', label1);

    g_form.removeOption('v_email_address', 'new');
    g_form.addOption('v_email_address', 'new', newEmail);

}

 

Thanks in advanced!

Brijmohan

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@Brijmohan 

not possible with multi select variable type.

💡 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

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Brijmohan 

not possible with multi select variable type.

💡 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

Tanushree Maiti
Giga Sage

Hi @Brijmohan 

 

addOption, removeOption does not work on Multiple choice type variable. It works fine with Select Box type variable .

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: