> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Call recording insight text action

> Perform an action based on a text selection on a call recording insight

![](https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/text-selection-insight.png?fit=max\&auto=format\&n=2EyaTyByKNPeSVcd\&q=85\&s=9cfd4c214bd097eb35b3f801fbae831b)

Call recording insight text actions are shown when a user selects text in a call recording insight.

Add one by creating an extension folder under `src/app/extensions/` whose `extension.tsx` default-exports a `defineExtension` call with `type: "call-recording-insight-text-action"`. See [App structure](https://docs.attio.com/sdk/extensions/overview.md) for the discovery rules.

## Example

```tsx src/app/extensions/process-call-insights/extension.tsx theme={"system"}
import {Extensions, showDialog} from "attio/client"

import {ProcessCallInsightDialog} from "./process-call-insight-dialog"

export default Extensions.defineExtension({
  type: "call-recording-insight-text-action",
  id: "process-call-insights",
  label: "Process insights",
  onTrigger: async ({markdown, text}) => {
    await showDialog({
      title: "Process call insights",
      Dialog: ({hideDialog}) => {
        return <ProcessCallInsightDialog markdown={markdown} text={text} onDone={hideDialog} />
      },
    })
  },
})
```

## Arguments

**type** `"call-recording-insight-text-action"` *required*

Identifies this extension as an action on text selected in a call recording insight.

**id** `string` *required*

The unique identifier for this call recording insight selection action.

It is only used internally; never shown to the user.

**label** `string` *required*

A human-readable label of the call recording insight selection action that will be shown to the
user when they make a text selection on a call recording insight.

**icon** `string`

An [`AttioIcon`](../icons) to display beside the label.

> [!TIP]
>
> If no `icon` prop is provided, it will default to your app's icon that you set up in the
> [developer console](https://build.attio.com).

**onTrigger** `async (selection: \{text: string; markdown: string\}) =\> Promise\<void\>`

The function to run when the action is triggered. You'll likely want to [show a
dialog](https://docs.attio.com/sdk/dialogs/show-dialog.md) or run a [server function](https://docs.attio.com/sdk/server/server-functions.md) here.

The function will be given an object containing:

* `markdown` – a markdown representation of the text selected (e.g. may include bullet points)
* `text` – the plain text of the text selected


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.