# Set Selection

Selects the specified item on a control.

Action available for the following operating systems:

![](/files/-MAlQBZuuTnc6hyzKSVQ)

### Parameters

* **Control** - The control that you want to set the selection of.
* **Selection Type** - The type of selection you want to make. It can be one of:
  * By return value - You'll specify the return value of the item you want to select.
  * Value <*string> -* The return value, specified in the Control's content, of the item you want to select.
  * By index - You'll specify the index of the item you want to select.
  * Value <*numeric> -* The index of the item you want to select.

{% hint style="warning" %}
Specify 0 to unselect the Control.
{% endhint %}

{% hint style="info" %}
Indexes in Kalipso always start in 1.
{% endhint %}

{% hint style="info" %}
If we make a "Set Selection" to a table and immediately after, we use an Action like "Table Get Column Value" without specifying the line index (therefore passing the value zero), Kalipso returns an error, saying:\
\
\- Trying to get value from selected line, but there is no selected line!\
\
This happens because the Action "Set Selection" sends a message indicating that a selection should be done, but Kalipso doesn’t control when this selection is done. So Kalipso tries to execute immediately an action that doesn’t work by message. This action is executed immediately, but doesn´t indicates the line index and the selections wasn’t yet done. Therefore an error is returned.\
\
To resolve this issue you only need to pass the same index to all table actions where you have to use the line index and that index can be zero.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.sysdevmobile.com/kalipso5/developing/form/actions/actions-description/group-controls/set-selection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
