- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2025 08:29 PM
We have a list field on a form where users can select multiple options (for this discussion Airplane, Bicycle, Car and Not Applicable).
1. User selects Bicycle and Car.
2. User changes their mind and selects "Not Applicable". The previous two selections should be removed.
3. User selects Car again. Now the "Not Applicable" selection should be removed and replaced by the latest choice.
I did not find a way to do this using UI Policies and hence am trying Client Scripts. However, I am unable to figure out which event to use to get the previous value. The onchange event has the old value as of form load. But I need to get the previous changes that are not yet saved when the user stays on the page and performs the steps above sequentially.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 10:06 AM - edited 02-27-2025 10:07 AM
Hi @MyR You can create a UI policy (screenshot below) with Condition as "Field" Contains Not Applicable and Script > Execute if true
function onCondition() {
g_form.setValue('u_transport_medium', 'Not Applicable');
}
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 09:18 AM
you could use a UI Policy or client script for this:
g_form.clearValue('not applicable');
will clear out the check box value and just set it so that it runs when either of the two check boxes for "car" or "bicycle" have been marked. Then do the same for the "not applicable" field:
g_form.clearValue('car');
g_form.clearValue('bike');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 10:06 AM - edited 02-27-2025 10:07 AM
Hi @MyR You can create a UI policy (screenshot below) with Condition as "Field" Contains Not Applicable and Script > Execute if true
function onCondition() {
g_form.setValue('u_transport_medium', 'Not Applicable');
}
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 08:37 PM
Thank you for the detailed screenshots. It was helpful and I am able to accomplish steps 1 and 2 using this approach with UI policies instead of using client scripts. I am not yet able to fully solve for step 3 easily, but as a workaround, I will force the user to remove "Not Applicable" before adding one of the other options.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2025 03:21 PM
Hello @MyR
Step#3 or 3rd screenshot is from the Script tab of UI Policy.
Please mark the answer helpful if it resolved your issue.
Hope that helps!