How to auto populate a multi row variable set variable with value selected in drop down type of a catalog item variable

Shannu S
Kilo Explorer

Hi All,

I have created a multi row variable set on a catalog item. I need to auto populate a MRVS variable with the value selected in select box type variable.

For example, select box type variable is 'AB' and MRVS variable is XY.

AB has drop down values as P,Q,R. If I have selected 'P' in AB, same should auto populate in XY. Please help me to get this.

Any help would be appreciated.

 

Thanks in Advance!!

8 REPLIES 8

Ravi Peddineni
Kilo Sage

@Shannu S 

 

MRVS field accepts JSON formatted data. You can create an OnChange client script and use below code:

var result = {

<XY_FIELD_BACKEND_NAME> : newValue,

}

g_form.setvalue('MRVS_BACKEND_NAME', result);

Thanks for your quick response!!

I tried, but no luck.

Community Alums
Not applicable

Hi @Shannu S ,

Here is an article which will help you:

https://community.servicenow.com/community?id=community_article&sys_id=8014d1dadb9a20509e691ea668961...

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

there are some questions for your approach

So MRVS has only 1 variable XY in it or any other variable?

So on every change of Select box you want to add new row in MRVS or just change the variable value and keep only 1 row

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader