> ## 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 selection action

> Call recording insights text selection actions are a way to perform an action based on a text selection on a call recording insights.

<img className="dark:hidden" width="720" height="440" noZoom src="https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/text-selection-insight.png?fit=max&auto=format&n=2EyaTyByKNPeSVcd&q=85&s=9cfd4c214bd097eb35b3f801fbae831b" data-path="images/text-selection-insight.png" />

<img className="hidden dark:block" width="720" height="440" noZoom src="https://mintcdn.com/attio/2EyaTyByKNPeSVcd/images/text-selection-insight-dark.png?fit=max&auto=format&n=2EyaTyByKNPeSVcd&q=85&s=d267c2eeeaa91b79ecae6c8b75314bf1" data-path="images/text-selection-insight-dark.png" />

```ts theme={"system"}
import type {App} from "attio"
```

Register a call recording insight text selection action by creating an
`App.CallRecording.Insight.TextAction` and adding it to the `callRecording.insight.textActions`
array of your [`app.ts`](./app-ts) file.

## Example

```tsx process-call-insights.ts theme={"system"}
import type {App} from "attio"
import {showDialog} from "attio/client"
import {ProcessCallInsightDialog} from "./your-code"

export const processCallInsightsAction: App.CallRecording.Insight.TextAction = {
  id: "process-call-insights",
  label: "Process insights",
  onTrigger: async ({markdown, text}: {markdown: string; text: string}) => {
    await showDialog({
      title: "Process call insights",
      Dialog: ({hideDialog}: {hideDialog: () => void}) => {
        return <ProcessCallInsightDialog markdown={markdown} text={text} onDone={hideDialog} />
      },
    })
  },
}
```

```tsx app.ts theme={"system"}
import type {App} from "attio"

import {processCallInsightsAction} from "./process-call-insights"

export const app: App = {
  callRecording: {
    insight: {
      textActions: [processCallInsightsAction],
    },
    // ...
  },
  // ...
}
```

## Arguments

<ParamField path="id" type="string" required>
  The unique identifier for this call recording insight selection action.

  It is only used internally; never shown to the user.
</ParamField>

<ParamField path="label" type="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 insights.
</ParamField>

<ParamField path="icon" type="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 dashboard](https://build.attio.com).
  </Tip>
</ParamField>

<ParamField path="onTrigger" type="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](../dialogs/show-dialog) or run a [server function](../server/server-functions) here.

  The function will be given an object containing:

  * `markdown` – a markdown respresentation of the text selected (e.g. may include bullet points)
  * `text` – the plain text of the text selected
</ParamField>
