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

# replaceSectionItem()

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

> **Beta API.** Mostly stable, but details may change in a minor release, outside SemVer. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Creates the ReplaceSectionItem command. Dispatching this command will result in replacement of particular dashboard item with a new item. By default, the old item will be discarded, however you may specify to stash it for later use.

**Signature:**

```typescript
export declare function replaceSectionItem(sectionIndex: number, itemIndex: number, item: DashboardItemDefinition, stashIdentifier?: StashedDashboardItemsId, autoResolveDateFilterDataset?: boolean, correlationId?: string): IReplaceSectionItem;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| sectionIndex | number | index of section where the item to replace resides |
| itemIndex | number | index of item within the section |
| item | [DashboardItemDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboarditemdefinition/index.md) | new item definition |
| stashIdentifier | [StashedDashboardItemsId](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.stasheddashboarditemsid/index.md) | _(Optional)_ specify identifier of stash where the old item should be stored |
| autoResolveDateFilterDataset | boolean | _(Optional)_ specify whether dashboard should auto-resolve date dataset to use for date filtering of KPI or insight widget that is replacing the existing item; default is disabled meaning date filtering will be enabled only for those KPI or Insight widgets that already specify dateDataset. |
| correlationId | string | _(Optional)_ specify correlation id to use for this command. this will be included in all events that will be emitted during the command processing TODO LX-648: Consider removing this command variant and leave only a nested variant |

**Returns:**

[IReplaceSectionItem](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.ireplacesectionitem/index.md)

## Remarks

This command operates only on the root layout. For nested layouts, use [replaceNestedLayoutSectionItem()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.replacenestedlayoutsectionitem/index.md).
