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

# bucketsFind()

- 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/execution/buckets/bucketArray.ts

Finds bucket matching the provided predicate in a list of buckets.

**Signature:**

```typescript
export declare function bucketsFind(buckets: IBucket[], idOrFun?: string | BucketPredicate): IBucket | undefined;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| buckets | [IBucket](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ibucket/index.md)[] | list of buckets to search |
| idOrFun | string \| [BucketPredicate](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.bucketpredicate/index.md) | _(Optional)_ bucket predicate or string to match bucket by local identifier; [anyBucket](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.anybucket/index.md) is default |

**Returns:**

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

## Remarks

If no predicate is provided, then the function defaults to [anyBucket](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.anybucket/index.md) predicate - meaning first bucket in the list will be returned.

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