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

# insightModifyItems()

- 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

Creates a new insight with modified bucket items (retrieved by applying the modifications function to each bucketItem in the insight).

**Signature:**

```typescript
export declare function insightModifyItems<T extends IInsightDefinition>(insight: T, modifications?: BucketItemModifications): T;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| insight | T | insight to use as template for the new insight |
| modifications | [BucketItemModifications](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.bucketitemmodifications/index.md) | _(Optional)_ modifications to apply to the bucket items |

**Returns:**

T

always new instance

## Remarks

Note: the bucket item modification function SHOULD NOT modify bucket item's localId. The localId MAY be used to reference the item from other places in the insight (for example from sorts). Changing the item localId has potential to break the insight: as-is this function does not concern itself with changing the references.
