How to create UI policy on question choices.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 12:59 PM
I have to create a somewhat complex form where I need to use either multiple choice or select box for a number of variables. What I am trying to do is to have only certain question choices available depending on the drop down selection prior to it. Is there any way to use a Catalog UI Policy or anything else to make only certain question choices visible based on the variable chosen before it? Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2023 02:54 PM
Hi Brent,
Now, I get it. As you are trying to hide the choice value, you have to use script.
I was under the impression that you are willing to hide the entire variable.
Try using g_form.showOption() and g_form.hideOption() to show and hide question choices. It will work
// Get the HTML elements of the select box variables
var area = g_form.getControl(‘sap_service_area’);
var workstream = g_form.getControl(‘sap_services_workstream’);
// Define a function to show or hide the HR option based on the area value
function showHideHR() {
if (area.value == ‘sap_services_successfactors’) { // Show the HR option if area is Success Factors
g_form.showOption(‘sap_services_workstream’, ‘sap_services_HR’);
} else { // Hide the HR option if area is not Success Factors
g_form.hideOption(‘sap_services_workstream’, ‘sap_services_HR’);
}
}
You may need to modify it accordingly.
Kind Regards,
Swarnadeep Nandy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2023 01:47 PM
Thank you very much! Apologies for my late response, I was on vacation. I will write this script out tomorrow and test it out. If this works, I will accept solution! 🙂 Once again, many thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2023 12:56 PM
Hello,
I tried adding this script both to the UI policy section and to the catalog script, but it doesn't seem to be hiding or showing any of the question choices. I will keep modifying to see if I can figure out why.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2023 02:47 AM
Hi,
I do have a similar use case. Did you manage to implement this? If so, could you please share the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2024 01:01 PM
For the choices the best practice is through client script