# action

## Overview

An `action` can be linked to a cell on a `column` level, which will be triggered when a user clicks on the cell. 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>
    <column>
        <!-- `icon` is displayed on the right-hand-side of the cell -->
        <action on-press="processAction($selection)" icon="ion-chevron-right" />
    </column>
</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 in the cell. The icon can be a [Font Awesome icon](https://docs.journeyapps.com/reference/build/ui-components/icons#font-awesome-icons) or an [Ionicons icon](https://docs.journeyapps.com/reference/build/ui-components/icons#ionicons-icons).

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