---
title: "action"
description: "Add an action to the results of a typeahead table cell."
permalink: /docs/runtime/all-ui-components/object-table/column/edit-typeahead/action/
---
# action

## Overview

With the use of a nested `action` in an `edit-typeahead` an additional item will appear with the results of [`on-search`](/docs/runtime/all-ui-components/object-table/column/edit-typeahead/#on-search). If this item is selected, this `action` tag's [`on-press`](#on-press) will fire with the current search value.

### Basic Example

In this example we add the option to create a new user.

**main.view\.xml**

```xml
<object-table ...>
  <column ...>
    <edit-typeahead ...>
      <action label="Create User" icon="fa-user" on-press="$:createUser($object, searchValue)" />
    </edit-typeahead>
  </column>
</object-table>
```

**main.js**

```javascript
function createUser(object, searchValue){
    var user = DB.user.create();
    user.name = searchValue;
    user.save();
}
```

![](./media/spaces-2f9tchlr67elhbojpvhhud-2fuploads-2fgit-blob-79346d7abb4859497407adef91245380e8e3dfb2-2fedit-typeahead-action-example-b4f6c7a9.png)

## Standard Attributes

### `label`

<SyntaxCard type={"string (static text, format string, or JS/TS function result)"} defaultValue={"unset"} />

The text to display on the `action` item.

### `validate`

<SyntaxCard type={"boolean"} defaultValue={"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="$:createUser($object, searchValue)" validate="true" />
```

## Advanced Attributes

### `icon`

<SyntaxCard type={"string"} defaultValue={"fa-circle-plus"} />

The icon to display on the button, it will be placed on the left of the label by default. The icon can be a [Font Awesome icon](/docs/runtime/all-ui-components/icons/#font-awesome-library) or an [Ionicons icon](/docs/runtime/all-ui-components/icons/#ionicons-library).

```xml
<action icon="fa-user" on-press="$:createUser($object, searchValue)" />
```

## Common Attributes

### `on-press`

<SyntaxCard required />

<AttributeReference label="on-press" href="/docs/runtime/common-component-attributes/on-press/" />
