# Dispatch action configuration object

Defines when a text input element sends a `block_actions` interaction payload while the reader is still typing.

| | |
|---|---|
| **Used in** | [Plain-text input element](https://workstation.repzo.com/docs/developers/block-kit/elements/plain-text-input-element), [Email input element](https://workstation.repzo.com/docs/developers/block-kit/elements/email-input-element), [URL input element](https://workstation.repzo.com/docs/developers/block-kit/elements/url-input-element), [Number input element](https://workstation.repzo.com/docs/developers/block-kit/elements/number-input-element), [Rich text input element](https://workstation.repzo.com/docs/developers/block-kit/elements/rich-text-input-element) |

## Usage

Set it as the input element's `dispatch_action_config`. It only takes effect when the input block around the element has `dispatch_action: true`; otherwise the value only reaches your app when the form is submitted.

## Fields

| Field | Type | Description | Required? |
|---|---|---|---|
| `trigger_actions_on` | String[] | Which interactions send a `block_actions` payload. One or both of: `on_enter_pressed` — sent when the reader presses Enter while the input has focus; `on_character_entered` — sent when a character is typed or removed. Defaults to `on_enter_pressed`. | Optional |

> **How Repzo Chat differs from Slack**
>
> - `on_character_entered` waits for a short pause in typing (300 ms) and sends the latest value, rather than one payload per keystroke.
> - In a multiline `plain_text_input` and in a `rich_text_input`, Enter starts a new line; ⌘/Ctrl+Enter is what sends `on_enter_pressed`.

## Examples

### Search as the reader types

This example belongs in a modal view.

```json
{
  "blocks": [
    {
      "type": "input",
      "dispatch_action": true,
      "label": {
        "type": "plain_text",
        "text": "Find an account"
      },
      "element": {
        "type": "plain_text_input",
        "action_id": "account_search",
        "placeholder": {
          "type": "plain_text",
          "text": "Company name or VAT number"
        },
        "dispatch_action_config": {
          "trigger_actions_on": [
            "on_character_entered"
          ]
        }
      }
    }
  ]
}
```

## Related

- [Composition objects](https://workstation.repzo.com/docs/developers/block-kit/objects)
- [Block Kit overview](https://workstation.repzo.com/docs/developers/block-kit)
