How to clear checkbox type variable if All is selected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 03:54 AM - edited 08-29-2024 03:57 AM
Hi Guys,
I am having an issue I have created few variables with variable type as checkbox(attached screenshot for field deatils) I have multiple field as checkbox type also have a variable name as All it is also checkbox type, so the requirement is when I select All variable then other variable should be unticked and only All varible will be selected and if other variable is selected then All should be unticked.
I have created the UI Policy to clear the value of other variable when All is selected but it is not working when other variable is selected then All is also selected but I don't want All to be selected incase any other variable is selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 04:15 AM
Hii,
In the UI Policy, please check Applies on Requested Items on UI policy form.
If still not working try below.
function onChange(control, oldValue, newValue, isLoading) { if (isLoading) { return; } if (newValue != '') { //you can give value and clear based on the value g_form.clearValue('variablename'); //add your variable that need to clear } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 04:27 AM
Hi @abhaysingh98,
I am not able to view your screenshots due to restrictions but if you haven't used All variable in UI Policy Action, then add UI Policy Action for All and set the opposite value of the other variable to it and try it.
If you found my response helpful, please mark it as Solution and Helpful.
Thanks and Regards,
Ehab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 04:45 AM - edited 08-29-2024 04:46 AM
Can you paste the screenshot of the ui policy you have written when value is not all and other variable value is selected.
I think writing the UI Policy only for all should work when value of variable is ALL clear other variable values and under false condition i.e. when value is not all you can clear the ALL checkbox and set it to unchecked.
Please mark helpful/correct if my response helped you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 06:13 AM - edited 08-29-2024 06:16 AM
Hi @abhaysingh98,
when you are clearing value at the same time you need to make value readonly for other checkboxes.
You may try with the following configuration :
Please mark my response as correct and helpful if it helped solved your question.
Thanks,
Rohit Suryawanshi