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

Populate data of Single select field to multi-row variable

Xhare
Tera Contributor

Hi SN Community,

 

I have this requirement to auto populate what was selected in single select variable to my multi row variable field item.

How to achieved this?

 

I'm using client script below: But its not working.

 

var upgradeOpt = g_form.getValue('upgrade_options);

 

if (upgradeOpt == 'Memory Upgrade') {

g_form.setValue('item', 'Memory Upgrade');

}

1 ACCEPTED SOLUTION

Brad Bowman
Mega Patron

You can use g_service_catalog to get variables from outside of the MRVS, and you need a closing quote on the variable name:

 

var upgradeOpt = g_service_catalog.parent.getValue('upgrade_options');

The rest of your script should be fine as long as the value of the single select variable (not the text/label of this choice) is exactly 'Memory Upgrade'.

 

 

View solution in original post

1 REPLY 1

Brad Bowman
Mega Patron

You can use g_service_catalog to get variables from outside of the MRVS, and you need a closing quote on the variable name:

 

var upgradeOpt = g_service_catalog.parent.getValue('upgrade_options');

The rest of your script should be fine as long as the value of the single select variable (not the text/label of this choice) is exactly 'Memory Upgrade'.