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

# insightSorts()

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

Gets sorting defined in the insight.

**Signature:**

```typescript
export declare function insightSorts(insight: IInsightDefinition): ISortItem[];
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| insight | [IInsightDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iinsightdefinition/index.md) | insight to get sorts from |

**Returns:**

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

array of valid sorts

## Remarks

Note: this function ensures that only sorts working on top of attributes and measures defined in the insight will be returned. Any invalid entries will be stripped.
