Skip to main content

Group Picker Widget

OverviewDirect link to Overview

The Group Picker widget is a searchable dropdown component that allows users to select one or multiple groups from your system. It provides real-time search functionality with remote data loading and supports various configuration options for validation, styling, and user interaction.

Each group is a role of the platform. The list shows the name of the role, and the field stores its _id (see Value Storage).

Group Picker Widget

Basic ConfigurationDirect link to Basic Configuration

Global SettingsDirect link to Global Settings

NameDirect link to Name

  • Label: Name
  • Description: The display label for the group picker field
  • Type: Text input
  • Usage: This text appears as the field label in forms

Variable/ModelDirect link to Variable/Model

  • Label: Variable/Model
  • Description: The data model property name where selected values will be stored
  • Type: Text input
  • Required: Yes
  • Usage: Defines the variable name for accessing selected group data
  • Example: selectedGroups, userGroups

Selection OptionsDirect link to Selection Options

Multiple SelectionDirect link to Multiple Selection

  • Label: Multi
  • Description: Enable selection of multiple groups
  • Type: Toggle switch
  • Default: false
  • Usage: When enabled, users can select multiple groups from the dropdown. The value is then an array of role _id
Group Picker with two selected roles

ClearableDirect link to Clearable

  • Label: Clearable
  • Description: Allow users to clear their selection
  • Type: Toggle switch
  • Default: false
  • Usage: Adds a clear button to remove all selected values

The Group Picker has no Filterable switch: the search is always on. Users type in the field to search the roles by name.

No default value

The Group Picker has no Default Value field. To preselect a role, set its _id in the model from an action, for instance fillForm.

Group Picker Basic Configuration

Data Source ConfigurationDirect link to Data Source Configuration

The Group Picker automatically connects to your system's group API endpoint (/api/v1/group) and provides:

  • All the roles of the platform: the list is not limited to the roles of the project
  • Real-time search: Roles are searched by name as users type
  • 10 roles per search: With nothing typed, the list shows the 10 most recently created roles. Type a part of the name to reach the others
  • Selected roles kept: A role already selected stays in the list, even when a search does not return it
  • Automatic label mapping: Uses the role name property for display
  • Value mapping: Uses the role _id property as the stored value

Value StorageDirect link to Value Storage

The Group Picker stores data in three variables:

VariableContentSingle selectionMultiple selection
<model>The _id of the roleA stringAn array of _id
<model>_labelThe name of the roleA stringAn array of names
<model>_vbThe complete role objectAn array with one objectAn array of objects

With the model approval_roles and multiple selection:

approval_roles: ["655343a1c664176f846907a4", "655343b7c664176f846907b9"],
approval_roles_label: ["Finance", "Legal"],
approval_roles_vb: [
  { _id: "655343a1c664176f846907a4", name: "Finance" /* ... */ },
  { _id: "655343b7c664176f846907b9", name: "Legal" /* ... */ },
],
  • Use the _id to assign: tasks and emails are assigned by role ID, so the value can go directly in the Roles field of a process task. See Assigning a Task to the Selected Role.
  • Use <model>_label to display or compare a name.
  • Remove VB lists from the model: when this page setting is on, <model>_vb stays in the page: it is not saved and not sent to the process. <model> and <model>_label are still saved.
  • Value set by an action: the field reads the role by its _id and shows its name. fillForm on a Form, a Grid or a Section also updates <model>_label and <model>_vb. fillForm on the Main Form, or an action that sets the variable directly, does not update them: if the page reads them afterwards, set them in the action too. clearForm empties them.
  • Value saved before version 8.6: a role name is still shown as it is, and its text is used as the label. It is not converted: the variable keeps the name until the user selects a role again.
Changed in version 8.6

Up to version 8.5, the value of the Group Picker was the role name. Since version 8.6, a new selection stores the role _id. Rules, scripts, queries, reports and process gateways that compare the value with a name (for instance {{approval_role}} == "Finance") no longer match a new selection: compare <model>_label with the name, or the value with the _id. The data saved before 8.6 is not migrated: code that reads old instances or documents can find both forms.

Events and ActionsDirect link to Events and Actions

On Change ActionDirect link to On Change Action

  • Label: On Change
  • Description: Define the actions to run when the user changes the selection, or clears it
  • Type: Action builder: click Action on field change (View attached action once an action is saved). The drawer titles this chain On Click
  • Available Variables:
    • SF_input.value: The _id of the selected role (an array of _id with multiple selection)
    • SF_input.SF_data: The selected role object (an array of objects with multiple selection), with its _id and its name
    • SF_input.SF_currentIndex: Current loop index (if within a loop)

The chain does not run when an action or the page sets the value.

Example ActionsDirect link to Example Actions

This alert shows the name of the selected role with SF_input.SF_data.name:

Group Picker example action

Validation ConfigurationDirect link to Validation Configuration

Screen-based ValidationDirect link to Screen-based Validation

Configure validation rules for different screens (Create, Edit, View, etc.):

AvailableDirect link to Available

  • Description: Control whether the widget appears on specific screens
  • Type: Toggle switch per screen

VisibleDirect link to Visible

  • Description: Control widget visibility with dynamic conditions
  • Type: Toggle switch or JavaScript expression
  • Advanced: Use JavaScript expressions for dynamic visibility
  • Example: SF_connectedUser.roles.includes('655343a1c664176f846907a4')

RequiredDirect link to Required

  • Description: Make group selection mandatory
  • Type: Toggle switch or JavaScript expression
  • Validation: Displays error message if no group is selected

DisableDirect link to Disable

  • Description: Disable the widget to prevent user interaction
  • Type: Toggle switch or JavaScript expression
Group Picker Screen-based Validation

Custom Validation RulesDirect link to Custom Validation Rules

Add custom validation rules beyond basic required validation:

Rule Types AvailableDirect link to Rule Types Available

  • Min (Char) / Max (Char): Minimum and maximum number of characters of the value
  • Type: Expected type of the value (array, date, number)
  • Email: The value must be an email address
  • Regex: The value must match a regular expression
  • Custom: A condition to satisfy

The rules read the value of the field, which is the role _id: a Regex no longer checks the name of the role, and Min (Char) / Max (Char) do not count the selected roles.

Adding RulesDirect link to Adding Rules

  1. Open the Rules card
  2. Click Add rule
  3. Select rule type from dropdown
  4. Enter validation value
  5. Provide custom error message
Group Picker Custom Validation Rules

Styling and LayoutDirect link to Styling and Layout

Appearance OptionsDirect link to Appearance Options

PlaceholderDirect link to Placeholder

  • Label: Placeholder
  • Description: Hint text displayed when no group is selected
  • Type: Text input
  • Example: "Select a group...", "Choose groups..."

WidthDirect link to Width

  • Label: Width
  • Description: Control the width of the dropdown
  • Type: Text input
  • Values: CSS width values
  • Examples: 100%, 300px, 50rem

CSS ClassesDirect link to CSS Classes

  • Label: Class
  • Description: Add custom CSS classes for styling
  • Type: Text input
  • Usage: Space-separated class names
  • Dynamic Classes: Use the dynamic classes button for conditional styling
Group Picker Styling

Usage ExamplesDirect link to Usage Examples

Basic Single Group SelectionDirect link to Basic Single Group Selection

Group Picker Basic Single Group Selection

Dynamic Visibility Based on User RoleDirect link to Dynamic Visibility Based on User Role

In the Validation card, click Advanced Setting, then the pencil of the Visible column. With a single screen selected in the All Screens selector above the canvas, the pencils are already displayed. In the Advanced Setting Condition dialog, write the condition, then click Apply for this screen or Apply to All screens. Then click Save interface in the right rail, or the Saved indicator: Apply does not start the automatic save (see The Condition Editor). Here, the field is only shown to the users who hold a given role:

Group Picker Dynamic Visibility

Assigning a Task to the Selected RoleDirect link to Assigning a Task to the Selected Role

  1. Add a Group Picker with the model approval_role.
  2. In the user task of the process, write {{approval_role}} in the Roles field. The members of the selected role then receive the task.

With multiple selection, the process receives the array of _id and the task goes to the members of all the selected roles. The same value works for the roles of a send task. See Process Components.

Best PracticesDirect link to Best Practices

  1. Performance: The list loads 10 roles per search: give the roles names that are easy to search
  2. User Experience: Provide clear placeholder text and labels
  3. Validation: Implement proper validation for required fields
  4. Accessibility: Ensure proper labeling for screen readers
  5. Error Handling: Provide meaningful error messages for validation failures

TroubleshootingDirect link to Troubleshooting

Common IssuesDirect link to Common Issues

  1. Groups not loading: Check API endpoint accessibility and authentication
  2. Search not working: Verify network connectivity and API response format
  3. Selection not saving: Ensure proper model binding and form configuration
  4. Validation errors: Check required field settings and custom validation rules
  5. A comparison with a role name no longer works: Since version 8.6 the value is the role _id: compare <model>_label, or use the _id
  6. A role is missing from the list: The list shows 10 roles per search: type a part of its name
  7. The field shows an ID instead of a name: No role has this _id any more: the role was probably deleted

DebuggingDirect link to Debugging

Access the browser's developer console to:

  • Monitor API calls to /api/v1/group (the list) and /api/v1/group/run/list (the selected roles read by _id)
  • Check stored values in comp_model
  • Verify event triggers and validation states