We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Catalog Item - MRVS

TejashviT
Tera Contributor

Hi Team,

 

We have three variables in MRVS, lets say MVar1 , MVar2, MVar3. 
And one reference variables outside MRVS, lets say Var4.

Based on the value in reference field Var4, we have to populate value in MVar2 and MVar3.

What I did is, I have created oncHange client script for Var4 which will be setting value MVar2 and MVar3.
g_form.setValue(MVar2,value1) ;
g_form.setValue(MVar3,value2).

But this is not working. Please guide, how can I achieve this .

Thanks in advance

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@TejashviT 

so you want to grab outside variable in MRVS Client Script

you can access the value like this

var outsideValue = g_service_catalog.parent.getValue("Var4"); // give outside variable name here

💡 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

This is for getValue but how can we setValue ?

@TejashviT 

I believe I answered your original question about how to get the value

now to your next question, did you try this and see if that works?

g_service_catalog.parent.setValue("Var4", "sysId");

OR check below links

Populate field outside MRVS with a total sum of fields inside MRVS 

MRVS detect when a row is removed or deleted

💡 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