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

how to fetch values from mvrs for variables outside from mrvs in servicenow

sariksorte
Tera Contributor
 
2 REPLIES 2

GopikaP
Mega Sage

Hi @sariksorte , In your client script - 

var mrvs = JSON.parse(g_form.getValue('mrvs')); //name of your mrvs 
    var rows = mrvs.length; 
    if (rows > 0) { 
        for (var i = 0; i < mrvs.length; i++) { 
               g_form.addInfoMessage(mrvs[i].user); //user is the variable inside mrvs
               g_form.addInfoMessage(mrvs[i].req_for); //req_for is the variable inside mrvs
            } 
        } 

GopikaP
Mega Sage

Hi @sariksorte, If it's the other way around, in your client script of MRVS -

var req_for = g_service_catalog.parent.getValue("req_for"); //'req_for' is the variable outside MRVS 
 g_form.addInfoMessage(req_for);