Use different choice lists for same field with UI policies - Catalog Item (Record Producer)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi all,
I hope I picked the correct board to ask my question 🙂
I have created a catalog item, with a record producer, where I would like to populate the same field with different choice lists (select box), depending on the outcome chosen in the field before.
So I made a Variable set with a select box for Function. When a function has been selected then the next field should display the relevant choice list for this Function.
So number 1 is where the Function is selected.
Then number 2, 3 and 4 is the Function variables with the Choice lists.
So if Audit is selected in Function, then the choice list from variable 2 should display.
I have created UI policies for the dependencies, but it's working like the wild west!
Can anyone give me a hint to why it's not working as expected?
Thanks 🙂
BR, Susanne
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Susanne Bredal
Hope you are doing well. I think we cannot leverage native UI dependency solution that works on incident in this scenerio. So if the choices are not many and its nothing very complex you can simply use onChange Client scripts to clear values using clearOptions and then adding your choices in the script using addOptions
Let me know if you need more information
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Something like this
function onChange(control, oldValue, newValue, isLoading) {
// If the form is loading or the field is cleared, reset Variable B
if (isLoading || newValue === '') {
g_form.clearOptions('access_level');
g_form.addOption('access_level', '', '-- None --');
return;
}
// 1. Clear all existing options to start fresh
g_form.clearOptions('access_level');
g_form.addOption('access_level', '', '-- None --');
// 2. Add options based on the selection in Variable A
if (newValue == 'finance') {
// g_form.addOption('variable_name', 'value', 'label');
g_form.addOption('access_level', 'billing', 'Billing Admin');
g_form.addOption('access_level', 'reporting', 'Financial Reporting');
} else if (newValue == 'it') {
g_form.addOption('access_level', 'admin', 'System Admin');
g_form.addOption('access_level', 'help_desk', 'Help Desk Agent');
g_form.addOption('access_level', 'security', 'Security Analyst');
} else if (newValue == 'hr') {
g_form.addOption('access_level', 'payroll', 'Payroll Specialist');
g_form.addOption('access_level', 'recruiter', 'Recruiting Lead');
}
}
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Susanne Bredal . As @Yousaf suggested, you will have to use catalog client script for the dropdown values. Catalog UI Ploicies are mainly for making fields read-only, mandatory and visible.
