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

# insightBucket()

- 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

Finds bucket matching the provided predicate in an insight.

**Signature:**

```typescript
export declare function insightBucket(insight: IInsightDefinition, idOrFun?: string | BucketPredicate): IBucket | undefined;
```

## 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 work with |
| idOrFun | string \| [BucketPredicate](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.bucketpredicate/index.md) | _(Optional)_ local identifier or bucket predicate |

**Returns:**

[IBucket](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ibucket/index.md) &#124; undefined

undefined if none match

## Remarks

This function also provides convenience to find bucket by its local identifier - if you pass predicate as string the function will automatically create idMatchBucket predicate.
