In Service catalog check box field mandtory

nameisnani
Mega Sage

Hi Team , 

 

Can anyone please help me here , 

 

when ever ' Does the request incliude ....... ' is selected Yes . Then ' Select the data domain and check box has to be visible . how to acheive this .

 

nameisnani_0-1730170464620.png

nameisnani_1-1730170508273.png

 

I have written a UI policy which is not working as per my requirement 

nameisnani_2-1730170767396.png

 

 

I haven't selected Yes ,  but label and checkbox are showing .

nameisnani_3-1730170851316.png

 

 

can anyone please help me here 

19 REPLIES 19

Hi @nameisnani ,

 

Try with the below Onchange client script: Adjust the variable names accordingly.

(function executeRule(current, previous /*null when async*/) {
    // Check if the selected value is "Yes"
    if (g_form.getValue('does_the_request_include') === 'Yes') {
        g_form.setDisplay('select_data_domain', true);  // Show "Select the data domain"
    } else {
        g_form.setDisplay('select_data_domain', false);  // Hide "Select the data domain"
    }
})(current, previous);

 

Thanks,

Pradeep 

"If this response was useful, please select 'Accept as Solution' and mark it as 'Helpful.' This helps me provide better answers and assists the community ".

Regards,
Pradeep

@Pradeep Thipani  

 

check box also has to be visible Please provide an updated script for me .

 

nameisnani_0-1730177447748.png

nameisnani_1-1730177558437.png

 

Hi @nameisnani 

 

This scenario should ideally be managed with a simple UI Policy. I ran a quick test, and it seems the UI Policy can control checkbox visibility as expected.

Timi_0-1730182837317.png

Timi_1-1730182844302.png

 

So, it would be best to identify the underlying conflict that's preventing the checkboxes from hiding when "None" is selected, rather than adding additional scripts to work around the issue.

 

Cheers,

Tai Vu

nameisnani
Mega Sage

nameisnani_0-1730178386595.png

@Pradeep Thipani @Tai Vu 

 

 

Please provide correct script for me 

akashm
Tera Contributor

Hi @nameisnani 

You have to add those 3 checkboxes in that UI Policies action then it will work.

 

Regards,

Akash Mane

Please mark my answer as correct and helpful if it works for you.