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

# insightSetLayers()

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

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Gets a new insight that 'inherits' all data from the provided insight but has different layers.

**Signature:**

```typescript
export declare function insightSetLayers<T extends IInsightDefinition>(insight: T, layers?: IInsightLayerDefinition[]): T;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| insight | T | insight to work with |
| layers | [IInsightLayerDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iinsightlayerdefinition/index.md)[] | _(Optional)_ new layers to apply |

**Returns:**

T

always new instance

## Remarks

New layers will be used in the new insight as-is, no merging with existing layers.
