Role Picker

The Role Picker view enables users to switch between roles that are assigned to them. You can use the Role Picker view at the case level or at the solution level to select which role to use for accessing tasks and resources.

The Role Picker view displays all roles that are assigned to the current user. Users with multiple roles can select which role to use for their current work session.

In earlier releases, the Role Picker view was designed for use at the case level, within the case details page. In the current release, the view is enhanced to support usage at the solution level, enabling role selection across the entire solution rather than being confined to individual cases.

To assign users to a role:
  1. Add the Role Picker view to any solution layout (case, task, custom).
  2. Select the new role from the Switch Role drop-down list.
  3. Click OK to save your changes.

Configuration properties

Table 1. Role Picker view
Property Description Data type
Common
Label The label text that appears for the Role Picker view. String
Help The help text that provides additional information about the Role Picker view. String
Control ID The unique identifier for the Role Picker control. This ID can be used to reference the control in scripts or other parts of the application. String
Behavior
Binding The data binding for the Role Picker view. This property connects the view to a data source or variable. String
View The view configuration for the Role Picker. This property determines how the Role Picker is displayed and behaves within the user interface. String
Label visibility Controls whether the label is displayed. Options include Show (display the label) or Hide (hide the label). String
General options
Case identifier Specifies the unique identifier for the case. Use this property when you implement the Role Picker view at the case level, such as within a case details page. String
Target Object Store Name The repository name that the view needs to connect. String
Show Role Picker button Controls whether the role picker button is displayed in the user interface. When enabled, the button appears and allows users to switch roles. Boolean
Is Case Client Indicates whether the view is being used in a case client context. Set to true when using the Role Picker within case-related pages. Boolean
Solution prefix The prefix of the solution. Use this property when implementing the Role Picker view at the solution level. This configuration enables the view to work across the entire solution layer rather than being limited to individual cases. String
Appearance
Color style The color style for the button. Options include Primary, Info, Success, Warning, Danger and Dark. Each option applies a different color scheme to the button. String
Shape style The shape style for the button. Options include rounded, flat, or default. String
Size The size of the button. Options include extra small, small, default, and large. String
Outline only When enabled, displays the button with an outline style without internal colors. Boolean
Icon The icon to display on the button. You can specify any valid icon identifier. String
Width The width of the button. String
Icon location The location of the icon relative to the button text. String
Ghost style When enabled, displays the button with no solid fill. The body of the button adopts the look of the background. Boolean

Events

You can add JavaScript ES6 scripts for the following events. The scripts run in the client browser. For specific events, you can only use a formula or expression. Do not use template literals.

Table 2. Role Picker view events
Event Description
On role selected This event fires when a user selects a role from the Role Picker dropdown. You can use this event to run custom JavaScript code or trigger other actions in response to the role selection. The event provides access to the selected role information to update the user interface or perform other operations based on the newly selected role.

Usage scenarios

Case-level usage
When using the Role Picker view at the case level, configure the Case identifier property to specify which case the role selection applies to. This scenario is typical when the view is embedded in a case details page.
Solution-level usage
When using the Role Picker view at the solution level, configure the Solution prefix property instead of the case identifier. This scenario enables role selection across the entire solution, such as in a task list or solution layout.

Role display behavior

The Role Picker view displays only roles that are assigned to the current user. For example, if a solution has five roles but the user is assigned to only four, only those four roles appear in the list. This behavior helps the users see only the roles that they can use, simplifying role selection and preventing confusion about available permissions.

Methods

For the methods that are available in the Role Picker view, see Role Picker JavaScript API.

Additional resources
For more information about how to create a coach or page, see Building coaches.
For more information about standard properties (General, Configuration, Positioning, Visibility, and HTML Attributes), see View properties. For other UI views, see UI toolkit.