Hi,

then clear it only when the value selected is None

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading){
        return;
    }

    if(newValue == 'Yes'){
        g_form.setValue('hiddenVariable', 'Yes');
    }
    else if(newValue == ''){
        g_form.clearValue('hiddenVariable');
    }

    if(g_form.getValue('hiddenVariable') == 'Yes' && newValue == 'No'){
        // your logic
    }

}

Regards
Ankur

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

View solution in original post