Hide uncheck checkboxes inside a multi row variable set

test3445
Tera Contributor

Hello , 

 

I have a multi row variable set that has check boxes that represent canada provinces, but when only once province is selected the unselected ones show as false. Is there a script to use to hide the false values in the portal and in the back end as well?  

2 REPLIES 2

palanikumar
Giga Sage

Hi,

Multi row variable set is accessible as JSON string. You can create onchange catalog client script and update the field. Refer the sample code

 

    var mrvs = JSON.parse(g_form.getValue('mrvs_variable_set')); 
    // Replace mrvs_variable_set with actual variable set name

    for (var i = 0; i < mrvs.length; i++) {
        mrvs[i].hide=false; // replace hide with actual variable
    }

    g_form.getValue('mrvs_variable_set',mrvs);
    // Replace mrvs_variable_set with actual variable set name

Even in backend you multi row variable set is store as JSON. You can follow similar script to update the mrvs_variable_set

Thank you,
Palani

test3445
Tera Contributor

for reference 

test3445_0-1764798111646.jpeg