> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# selectInsights()

- Package: [@gooddata/sdk-ui-dashboard](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/index.md)
- Kind: function
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-dashboard/src/model/store/insights/insightsSelectors.ts

Selects all insights used on the dashboard.

**Signature:**

```typescript
selectInsights: (state: DashboardState) => IInsight[]
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| state | [DashboardState](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardstate/index.md) |  |

**Returns:**

[IInsight](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iinsight/index.md)[]

## Remarks

Note: if you are aiming to lookup insights using an ObjRef, then you should instead use the map returned by [selectInsightsMap](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.selectinsightsmap/index.md). If you are aiming to lookup a single insight by its ref, use [selectInsightByRef()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.selectinsightbyref/index.md). Using these selectors is both faster and safer as they take ObjRef type into account and look up the insight depending on the type of the ref.

See [selectInsightsMap](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.selectinsightsmap/index.md) or [selectInsightByRef()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.selectinsightbyref/index.md) for a faster and safer ways to get an insight by its ObjRef.
