# action

## Overview

Similar to [`bind`](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/object-table/..#bind), an `action` can be triggered when a user clicks on an `object-table` row. In this case, the specified [`on-press`](#on-press) function will execute.

{% hint style="info" %}
See more information in the guide on `object-table` [actions](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/object-table/object-table-guides/actions).
{% endhint %}

### Basic Example

{% code title="main.view\.xml" %}

```xml
<object-table ...>
    <action icon="fa-angle-right" on-press="$:rowAction($selection)" validate="false" />
    ...
</object-table>
```

{% endcode %}

## Standard Attributes

### `on-press`

{% content-ref url="../../xml-fields/on-press" %}
[on-press](https://docs.journeyapps.com/reference/build/ui-components/xml-fields/on-press)
{% endcontent-ref %}

### `validate`

**Optional**

**Type**: `boolean`

**Default**: `false`

Set to `true` to ensure that no required input fields in the current view are empty before performing the [`on-press`](#on-press) action.

```xml
<action on-press="processAction($selection)" validate="true" />
```

## Advanced Attributes

### `icon`

**Optional**

**Type**: `string`

**Default**: unset

The icon to display on the right end of the row. JourneyApps supports icons from various sources - see [icons](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/icons "mention")for details.

```xml
<action icon="fa-user" on-press="processAction($selection)" />
```
