Fetching value of variable from normal variable set and use in client script written on MRVS

Asmita7
Tera Expert

How can we fetch the value of a variable from a normal and use it inside through catalog client script.

 

eg. g_form.getValue('variable_name');

OR

g_form.get('variable_set . variable_name');

OR

g_form.getDisplay('variable_set . variable_name');

 

g_form.get('variable_name');

 

g_form.getDisplayValue('variable_name');

 

No option worked.

 

Please help and correct me.

 

 

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hi @Asmita7 

 

At catalog item level you can access the single row variable set variables but for multi row variable set works different.

 

You can get the JSON data of MRVS at Catalog Level by using 

var mrvs_data = g_form.getValue('YOUR MRVS INTERNAL NAME');

mrvs_data = JSON.parse(mrvs_data);

 

Then you can iterate through the JSON object to get the value you want.

 

Please mark my answer helpful and accept as a solution if it helped 👍

Thanks,
Anvesh

View solution in original post

4 REPLIES 4

AnveshKumar M
Tera Sage
Tera Sage

Hi @Asmita7 

Are you writing your Client Script at Catalog Item level or Variable Set level?

Thanks,
Anvesh

Hi @AnveshKumar M ,

Thank you for time.

Onchange catalog CS at variable set level.

When I use Catalog Item then MRVS is not available in variable name to apply onChange CS.

Please suggest.

AnveshKumar M
Tera Sage
Tera Sage

Hi @Asmita7 

 

At catalog item level you can access the single row variable set variables but for multi row variable set works different.

 

You can get the JSON data of MRVS at Catalog Level by using 

var mrvs_data = g_form.getValue('YOUR MRVS INTERNAL NAME');

mrvs_data = JSON.parse(mrvs_data);

 

Then you can iterate through the JSON object to get the value you want.

 

Please mark my answer helpful and accept as a solution if it helped 👍

Thanks,
Anvesh

Hi @AnveshKumar M ,

I want to fetch value from SRVS variable inside MRVS through catalog client script.

Please suggest.