How to add more dependent values to one choice field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 02:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 02:18 AM
You can only add 1 dependent value using the dictionary dependent value functionality, if you need to add more you'll have to use a client script to add/remove options depending on values on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 02:48 AM
Can you send any sample script Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 03:54 AM
It depends on the field types you're working with but i'm going to assume they're choice fields so you can use addOption() and removeOption() in an onChange script running on the category field.
The arguments for each method are ('string field name', 'choice value', 'choice label', 'choice order (optional)')
if(newValue == 'hardware' && g_form.getDisplayBox('assignment_group').value == 'Hardware Group'){
g_form.removeOption('subcategory', '1', 'software option');
g_form.addOption('subcategory', '2', 'hardware option');
}
If you're just adding or removing an option here or there you can do this in the script, if you have more complex requirements i would recommend adding the choice options in a script include and using a GlideAjax call to return the options to the client
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2018 02:23 AM
You can use an OnChange client script on a field to show all the options/fields you want based on the selection by the user.