how to access MVRS variables outside mvrs for to autopopulate catalog item variables

sariksorte
Tera Contributor

how to access MVRS variables outside mvrs for to autopopulate catalog item variables

1 ACCEPTED SOLUTION

Hi @sariksorte Please try this - 

//Type appropriate comment here, and begin script below
    var obj = JSON.parse(g_form.getValue('application_namespace_configuration'));
    alert(obj);
    for (var i = 0; i < obj.length; i++) {
        g_form.addInfoMessage(obj[i].app_nickname); //user is the variable inside mrvs
		obj[i].app_nickname = "HI";
    }
	g_form.setValue('application_namespace_configuration', JSON.stringify(obj));

For me this script is working and setting the variables values inside the MRVS. Please let me know at which point in the script it is not functioning as expected?

View solution in original post

12 REPLIES 12

onchange is on 'landscape' variable not on mvrs I want to populate 'nickname'(nickame is in mvrs) on 'jenkins_access_group_name'

Ankur Bawiskar
Tera Patron
Tera Patron

@sariksorte 

so you want to access MRVS variables when you write onChange catalog client script on outside variable?

if yes then this syntax should work for you

var mrvsData = g_form.getValue('application_namespace_configuration');

Please share complete client script and what's your business requirement

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

Hi Ankur this syntax is not working