Identity Selection
How to let a user select one or more identities before a Forms Flow starts, with single and multiple selection examples
Identity Selection lets a user choose the identity or identities a Forms Flow will work with before its first Step is displayed. Configure it on the Flow when the same process should apply to different people, rather than building a separate Flow for each person.
The page starts with an overview and a quick start, then shows example configurations. Later sections go deeper into data, Pipes and limits.
At a glance
Section titled “At a glance”| Single selection | Multiple selection | |
|---|---|---|
| Setting | "selection": "single" (default) |
"selection": "multi" |
| Typical use | Help desk: update one user | Bulk administration: apply one action to several users |
| In the browser | Click a row; the selection is confirmed at once | Tick rows, or select all filtered rows, then press Continue |
| Selected data in Forms configuration | ${flow.identity.displayName} |
${flow.identities.0.displayName}, ${flow.identities.1.displayName}, … |
id_selected in Pipe requests |
A string: "demo-user-1" |
An array: ["demo-user-1", "demo-user-2"] |
Everything else is shared: the search, the result table, the limits and what the browser is allowed to see work the same way in both modes. See Single and multiple selection for the full comparison.
Quick start
Section titled “Quick start”The smallest useful configuration searches automatically when the Flow opens and lets the user pick one identity. Only pipe_id and columns are mandatory:
{ "name": "manage-user", "public": false, "identity_selection": { "pipe_id": "forms.manage-user.search", "columns": ["displayName", "department"] }, "steps": "@include:steps/*.json"}A Step can then show the selected identity:
{ "id": "selected_identity", "type": "Markdown", "data": "Selected user: ${flow.identity.displayName}"}The search Pipe forms.manage-user.search must exist; see The search Pipe.
How it works
Section titled “How it works”- The user opens the Flow. Before any Step is shown, the Flow asks for an Identity Selection.
- The search Pipe runs. With
prompt.controls, the user first enters search criteria; without them, the search runs automatically. - The result is shown as a table of the configured
columns. The user selects one identity (single) or one or more (multiple). - The server stores the selection,
pre_piperuns, and the first Step is displayed.
Identity Selection is part of the Flow, rather than a Control on a Step. The selection must be completed before pre_pipe or any Step runs. It is locked once made: the selected identities remain fixed during the Flow, and a second selection attempt is rejected. Restarting the Flow, for example with buttons.restart_button, clears the selection so the user can choose again. Cancelling the selection returns the user to the launchpad.
Examples
Section titled “Examples”Each example shows only the identity_selection object. Place it in flow.json, or in a separate file included with "identity_selection": "@include:identity_selection/identity_selection.json".
Single selection, automatic search
Section titled “Single selection, automatic search”The search runs when the Flow opens and the user clicks the identity to work with. Suitable when the Pipe already knows which identities are relevant, for example a manager's direct reports.
{ "pipe_id": "forms.my-team.search", "selection": "single", "title": "Select a team member", "max_results": 50, "display_property": "displayName", "columns": [ { "key": "displayName", "label": "Name" }, { "key": "department", "label": "Department" } ]}Single selection, with search criteria
Section titled “Single selection, with search criteria”The user enters criteria first. Use this when the directory is too large to list, such as a help desk looking up any user.
{ "pipe_id": "forms.helpdesk.search", "selection": "single", "title": "Select identity", "max_results": 20, "display_property": "displayName", "columns": [ { "key": "displayName", "label": "Display name" }, { "key": "department", "label": "Department" } ], "prompt": { "title": "Search for an identity", "controls": [ { "id": "name", "type": "Input", "data": "", "schema": { "type": "string", "title": "Name" } } ] }}Multiple selection, automatic search
Section titled “Multiple selection, automatic search”The user sees all candidates and ticks the ones to include. Suitable for a bulk action over a known, limited group.
{ "pipe_id": "forms.bulk-update.search", "selection": "multi", "title": "Select identities", "max_results": 100, "display_property": "displayName", "columns": [ { "key": "displayName", "label": "Display name" }, { "key": "department", "label": "Department" } ], "sort_priority": ["displayName"]}Multiple selection, with search criteria
Section titled “Multiple selection, with search criteria”The user narrows down the list with criteria and can search again. Rows selected before a new search are not kept when the result set is replaced, so the user selects from the latest result.
{ "pipe_id": "forms.bulk-update.search", "selection": "multi", "title": "Select identities", "max_results": 200, "display_property": "displayName", "columns": [ { "key": "displayName", "label": "Display name" }, { "key": "department", "label": "Department" } ], "prompt": { "title": "Find identities", "controls": [ { "id": "department", "type": "Input", "data": "", "schema": { "type": "string", "title": "Department" } } ] }}Tuned result view
Section titled “Tuned result view”These options apply to both selection modes: help text, timeout, CSV export, sorting and column presentation.
{ "pipe_id": "forms.helpdesk.search", "selection": "single", "title": "Select identity", "description": "Pick the account to reset. Only active accounts are listed.", "max_results": 25, "timeout_ms": 10000, "display_property": "displayName", "allow_filter": true, "show_total": true, "show_export_button": true, "sort_priority": ["displayName", "department"], "columns": [ { "key": "displayName", "label": "Name", "presentation": { "type": "avatar" } }, { "key": "department", "label": "Department" }, { "key": "status", "label": "Status", "presentation": { "type": "badge" } } ]}Single and multiple selection
Section titled “Single and multiple selection”The only configuration difference is selection. It changes how the user selects, what the Flow receives and how you refer to the result.
| Aspect | Single | Multiple |
|---|---|---|
| User interaction | Clicking a row selects it and continues at once; there is no Continue button | A checkbox per row, a select-all checkbox for the filtered rows, a Selected counter, Clear selection and Continue |
| Number of identities | Exactly one; the server rejects more than one | One or more; duplicates are rejected |
| Forms configuration | flow.identity (object): ${flow.identity.mail} |
flow.identities (array of objects): ${flow.identities.0.mail}, ${flow.identities.1.mail} |
Pipe request id_selected |
String: ${request.id_selected} |
Array: ${request.id_selected.0} for the first id |
| Default heading and help text | Singular wording | Plural wording, and the number of selected rows is shown |
In both modes the Flow runs once. With multiple selection, the whole set is available to the Flow at the same time. A Pipe that performs the action receives all ids in id_selected and handles them in turn, while an expression such as ${flow.identities.0.mail} addresses only one identity at a time.
Use the selected identity in the Flow
Section titled “Use the selected identity in the Flow”Identity Selection makes the selection available in two ways: as normalized values for Forms configuration, and as the identifier or identifiers in Pipe requests.
| Where the data is used | How to address it |
|---|---|
| Forms configuration, single selection | ${flow.identity.uid}, ${flow.identity.id}, ${flow.identity.displayName} |
| Forms configuration, multiple selection | ${flow.identities} for the collection; ${flow.identities.0.uid} for the first selected identity |
pre_pipe, Step Pipes, finalize Pipes and tab Pipes |
request.id_selected: the id (single) or an array of ids (multiple) |
| A supported Control's Pipe | Explicitly map values with config.pipe_request, then read the mapped keys, for example request.uid |
Selected values in Forms configuration
Section titled “Selected values in Forms configuration”The search Pipe can return attributes that are not configured columns:
{ "items": [ { "id": "demo-user-1", "properties": { "uid": ["ada"], "displayName": ["Ada Lovelace"], "department": ["Engineering"], "roles": ["developer", "reviewer"] } } ]}With selection: "single", selecting this item publishes the following object as flow.identity:
{ "id": "demo-user-1", "uid": "ada", "displayName": "Ada Lovelace", "department": "Engineering", "roles": ["developer", "reviewer"]}The properties fields are lifted to the top level. An array with one element becomes that element; arrays with several elements remain arrays. Use ${flow.identity.uid}, not ${flow.identity.properties.uid}. The attribute does not have to appear in columns to be available here.
With selection: "multi", the same normalized objects are published in the flow.identities array instead. ${flow.identities.0.uid} addresses the first object's uid, and ${flow.identities.1.uid} the second.
Selected identities in Flow Pipes
Section titled “Selected identities in Flow Pipes”The Flow's pre_pipe, Step Pipes, finalize Pipes and tab Pipes receive the selection as the request parameter id_selected. They do not receive the selected items. Use the id to look up any further attributes the Pipe needs.
- Single selection:
request.id_selectedis a string, for example"demo-user-1". - Multiple selection:
request.id_selectedis an array, for example["demo-user-1", "demo-user-2"]. Use${request.id_selected.0}for the first id.
The value is set by the server and replaces any id_selected supplied by the browser or in input data. A Pipe can therefore rely on it to identify the selected identity. For example, this Valve in a pre_pipe checks the selected id:
{ "name": "AssertValue", "config": { "value": "${request.id_selected}", "regex": "demo-user-[12]" }}The search Pipe itself does not receive id_selected, because nothing has been selected yet.
Forms expressions such as ${flow.identity.uid} are evaluated by Forms. Inside a Pipe, use request data; the Forms flow scope is not automatically copied into the Pipe request. To add the normalized object to a Step Pipe's request as well, configure "pipe_request_parameters": ["identity"] on the Step, or ["identities"] for multiple selection. The single-selection object is then available as request.identity, with request.identity.uid equal to ada. See Identity Selection data and Pipe requests.
Selected values in Control Pipes
Section titled “Selected values in Control Pipes”Control Pipes do not receive the selected identity. Use config.pipe_request to pass only the values the Control's Pipe needs. This works on the first Step directly after Identity Selection, without an intermediate Input Control:
{ "id": "groups_for_selected_identity", "type": "DataGrid", "config": { "pipe_id": "forms.manage-user.groups", "pipe_request": { "uid": "${flow.identity.uid}", "department": "${flow.identity.department}" }, "columns": ["displayName", "description"] }}The Pipe reads request.uid as ada and request.department as Engineering. The request also includes the usual input data, accumulated delta and Control parameters.
pipe_request is supported by DataGrid, DataGridUpdate, ModalSelect, Selector, and ConfirmGenerateCode. RelationshipEditor does not support this setting. Values are ${...} expressions expanded on the server when the Pipe is called, using the flow, session, and utils scopes. The template and expanded values are not returned to the browser as part of the Control configuration. A Pipe's response can still supply data that the Control displays.
Configured pipe_request values override input data and accumulated delta with the same key. The Control's own parameters, such as search and columns, take precedence over pipe_request. Without pipe_request, the Control's request behavior is unchanged.
Data visibility
Section titled “Data visibility”Only the configured columns, display_property and a temporary __key for selection are sent to the browser in the search result. The real identifiers and the full items stay on the server, and the browser selects by key. Unknown or forged keys are rejected.
The display columns do not limit what is published in Flow State after selection. Return only the attributes the Flow needs from the search Pipe. Expressions used in rendered Controls, such as the Markdown example above, expose those values to the browser.
The selection debug message contains only projected display values. Accumulated Flow State can appear in exports in verbose Flow logs, including attributes that were not configured as columns. Consider both rendered expressions and verbose logging when configuring Flows that handle personal data.
The search Pipe
Section titled “The search Pipe”The Pipe named by pipe_id supplies the identities the user can select. The search request contains:
| Request key | Content |
|---|---|
| Control IDs | The validated prompt values, such as name in the examples above |
columns |
The configured column keys as a comma-separated list |
max_results |
The configured limit plus one, so the Flow can detect that the result is too large |
timeout_ms |
The server-controlled execution timeout |
| Input data | Parameters the Flow was started with |
columns, max_results and timeout_ms are set by the server and cannot be overridden by prompt values or input data.
Return selectable items with a non-empty string id and a properties object containing the configured display columns. The Pipe may also return total, the number of matches before limiting the result set. Items without a string id or without a properties object are ignored.
{ "items": [ { "id": "demo-user-1", "properties": { "displayName": "Ada Lovelace", "department": "Engineering" } } ], "total": 1}File layout and registration
Section titled “File layout and registration”Keep the search Pipe at flows/manage-user/identity_selection/pipe.json, beside identity_selection.json. This is the file layout used by Management Center. Give the Pipe the same ID as pipe_id and ensure the Pipes module loads it. For example, when config/modules/pipes.json and config/flows/ are sibling paths, add the Identity Selection pattern to the existing config.pipes include list:
{ "name": "Pipes", "config": { "pipes": "@include_as_array:../flows/*/pipes/*.json,../flows/*/identity_selection/pipe.json" }}Keep other existing Pipe patterns in that list. If Flows are stored under config/modules/flows/, use flows/*/identity_selection/pipe.json instead.
Scaffold search for demonstration
Section titled “Scaffold search for demonstration”For a local demonstration, pipe.json can use the scaffold Valve that Management Center creates. It filters a fixed candidate list with the request field name:
{ "id": "forms.manage-user.search", "config": { "valves": [ { "name": "IdentitySelectionScaffoldSearch", "config": { "filter_property": "displayName", "request_field": "name", "candidates": [ { "id": "demo-user-1", "properties": { "displayName": "Ada Lovelace", "department": "Engineering" } }, { "id": "demo-user-2", "properties": { "displayName": "Grace Hopper", "department": "Engineering" } } ] } } ] }}Configuration properties
Section titled “Configuration properties”| Property | Description | Default | Mandatory |
|---|---|---|---|
pipe_id |
ID of the registered search Pipe | N/A | Yes |
columns |
At least one unique display column; use a key string or an object with key, optional label and optional presentation |
N/A | Yes |
selection |
single or multi |
single |
No |
max_results |
Maximum number of results the user can select from; must be positive | 200 |
No |
timeout_ms |
Search Pipe execution timeout in whole milliseconds, from 1 to 21,600,000 | 30000 |
No |
title |
Heading of the selection view | Empty; a default heading for the selection type is used | No |
description |
Help text under the heading; must be a non-empty string when set | Empty; a default text for the search mode and selection type is used | No |
show_description |
Show the help text | true |
No |
display_property |
Display field; must match a configured column key | Empty | No |
allow_filter |
Allow filtering of the displayed results | true |
No |
show_total |
Show the result count, using total from the search Pipe when it is returned |
true |
No |
show_export_button |
Allow the user to export the filtered and sorted result rows to CSV | false |
No |
sort_priority |
Column keys used for result sorting priority | [] |
No |
prompt.title |
Heading of the search criteria form | Empty | No |
prompt.controls |
Controls that collect search criteria; omit or leave empty for automatic search | [] |
No |
Prompt controls use ordinary Forms Control configuration and need unique, non-empty IDs. A column object can also specify presentation with exactly one type: text, avatar, or badge.
Automatic search and search criteria
Section titled “Automatic search and search criteria”prompt.controls decides whether the user is asked before searching.
Automatic (no prompt.controls) |
Prompt (prompt.controls set) |
|
|---|---|---|
| When the search runs | When the Flow opens | When the user submits the criteria |
| Searching again | Not offered; a Retry button is shown if the search fails | The user can enter new criteria |
| Best for | Short, predictable candidate lists | Large directories and help desk lookups |
CSV export
Section titled “CSV export”Set show_export_button to true when the user should be able to download the current result view as CSV. The export contains the configured result columns in their displayed order and the rows that remain after filtering and sorting. Internal selection keys and other properties are excluded. Multivalue attributes are written into one CSV cell, and the file uses UTF-8 with a byte order mark for spreadsheet compatibility.
Result limits and errors
Section titled “Result limits and errors”| Situation | What happens | What to do |
|---|---|---|
| No items returned | The user stays at Identity Selection and sees an empty-result message | Prompt mode: search again with other criteria. Automatic mode: check the search Pipe |
More than max_results items, or total above max_results |
The results cannot be selected and a message says the result is too large | Prompt mode: enter narrower criteria. Automatic mode: adjust the search Pipe or the limit |
| Search Pipe missing, failing or timing out | The selection cannot complete | Make sure pipe_id refers to a registered Pipe and that its result follows the item format above |
| Result set is no longer valid | The user is asked to search again | Search again |
A configuration error, such as a missing pipe_id, a display_property that is not a column, or duplicate column or prompt control IDs, prevents the Flow from loading and names the Flow in the error message.