Select Multiple Items

Selects multiple items in a list or drop-down list. Works on Windows and browser elements; throws an error on SAP and Java elements. By default, Element uses the element found by the Get Element activity. If one of the requested items cannot be found or selected, or if multiple items are requested in a single-selection list, the activity throws an error; the error message lists the items that could not be selected.


⬅️INPUT

Parameter

Type

Required

Description

Element

IElement

✅ Yes

The list to select in. On Windows, if the surrounding pane or an item of the list is given instead of the list, the related list is found; in lists with check boxes, the boxes are checked. If empty (null), the activity throws an error.

Timeout

TimeSpan

❌ No

In the browser, the maximum time to wait for the page to respond. If left empty, 30 seconds. Not used for Windows elements.

SelectedKeys

String[]

❌ No

Keys of the items to select. Compared with the option's display text in the browser and with the item's text on Windows. Either SelectedKeys, SelectedValues or SelectedIndexes must be set; if more than one is set, the items indicated by all of them are selected. Empty strings are ignored. On Windows, case and leading/trailing spaces are ignored.

SelectedValues

String[]

❌ No

Values of the items to select. Compared with the option's value (value) in the browser and, as with keys, with the item's text on Windows.

SelectedIndexes

Int32[]

❌ No

Positions of the items to select (zero-based).

AddToSelection

Boolean

❌ No

If False, selected items that were not requested are deselected. If True, the requested items are added to the current selection.


Usage

If the activity is inside an activity with a selector (e.g. Get Element), the Get Selectable Items button on the canvas fetches the items of the list found by that parent activity's selector.

  • Items can be filtered with the Filter box. The items to select are checked.

  • Set Indexes, Set Values and Set Keys write the checked items to the related field and clear the other two fields. Set Keys is not available for Windows items that have no key.

  • The Indexes, Values and Keys fields can also be filled manually or with a variable.