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

5 REPLIES 5

Tanushree Maiti
Tera Patron

Hi @TejashviT x

 

Try with this once as from item level  Onchange Catalog Client script on variable Var4- you want to set MRVS variables

 

var mrvsArray = [];
var firstRow = {
"MVar2": "value 1",
"MVar3": "value 2"
};

mrvsArray.push(firstRow);
g_form.setValue('your_mrvs_internal_name', JSON.stringify(mrvsArray));

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti