- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2026 09:53 AM
Hello @khareakshay
I replicated your scenario. exactly in my PDI. I created the Exact variables you mentioned in the question and also a MRVS.
Refer Screenshot Service catalog.
I created an on change client script as well. For me it worked well.
MVRS - it cleared for me in every run, both renderers, model went to empty and the grid went back to No data to display.(please refer onchange client script screenshot)
Coming to changes_entity_appointment_ownership select box, if you have none checked in the type specifications of the variable, the script should clear the option you selected and fallback to none.
But, if you haven't checked none, by default it will fallback to the question choice with the lowest order.
please find the screenshot of the onchange client script i used in my PDI. Modify according to your requirement it will work.
Please Mark Helpful, if my reply added any Value!!
Regards
Raghavendra G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2026 06:34 AM
Hi @RaghavendraGund ,
My script works when I change the value of variable to something different but it did not work if I remove the selected value of variable. FYI the variable on which this client script works is of type reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2026 09:56 AM
Hi @khareakshay ,
Your g_form.clearValue() syntax is correct. The issue is most likely with the Select Box variable configuration rather than clearValue() itself.
For a Select Box variable, first check whether the variable allows an empty value.
Recommended approach:
1. Open the changes_entity_appointment_ownership variable.
2. Make sure "Include none" is enabled.
3. Make sure there is no Default value configured.
4. Check that another Catalog Client Script or Catalog UI Policy is not setting the value again.
Then this should be sufficient:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.clearValue('entity_name');
g_form.clearValue('changes_entity_appointment_ownership');
}
The important point is that clearValue() clears the selected value; it does not remove the choices from the Select Box.
If the Select Box does not have an empty/None option, the control may continue to display a selectable value instead of remaining blank.
Do not use clearOptions() just to reset the selected value, because clearOptions() removes the available choices themselves.
If the choices are being generated dynamically and you intentionally use clearOptions(), add the blank option back before adding the valid choices:
g_form.clearOptions('changes_entity_appointment_ownership');
g_form.addOption('changes_entity_appointment_ownership', '', '-- None --');
Then add the required choices.
Regarding appointments:
Since appointments is an MRVS, treat it separately. If the requirement is to remove all MRVS rows, you can reset the MRVS value using an empty JSON array:
g_form.setValue('appointments', JSON.stringify([]));
So I would test the Select Box first with "Include none" enabled. If it still does not clear, check the browser console and verify whether another Catalog Client Script/UI Policy is repopulating that variable immediately after this script executes.
Hope this helps!
If this response helped, please mark it as Helpful.
If it resolves your issue, please Accept it as Solution.
Kind Regards,
Abhishek Pal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2026 06:33 AM
Hi @Abhishek Pal ,
My script works when I change the value of variable to something different but it did not work if I remove the selected value of variable. FYI the variable on which this client script works is of type reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2026 06:51 AM