how to manipulate values in dropdown for user depending on role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 02:58 AM
show or hide values in a dropdown based on role of logged in user on load of Incident form. How to achieve this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 03:02 AM
you can write script
if (gs.hasRole("admin")) {
// Set values for admin role
g_form.setOptions("incident_dropdown_field", [
{ value: "value1", displayValue: "Option 1" },
{ value: "value2", displayValue: "Option 2" },
// Add more options as needed
]);
} else if (gs.hasRole("itil")) {
// Set values for itil role
g_form.setOptions("incident_dropdown_field", [
{ value: "value3", displayValue: "Option 3" },
{ value: "value4", displayValue: "Option 4" },
// Add more options as needed
]);
} else {
// Set default values or hide the field
g_form.hideRelatedList("incident_dropdown_field");
}