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

# defWithDimensions()

- 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/executionDefinition/factory.ts

Configures dimensions in the exec definition.

**Signature:**

```typescript
export declare function defWithDimensions(definition: IExecutionDefinition, ...dims: Array<IDimension | DimensionGenerator>): IExecutionDefinition;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| definition | [IExecutionDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iexecutiondefinition/index.md) | execution definition to alter |
| dims | Array&lt;[IDimension](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.idimension/index.md) \| [DimensionGenerator](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.dimensiongenerator/index.md)&gt; | dimensions to set |

**Returns:**

[IExecutionDefinition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iexecutiondefinition/index.md)

new execution with the updated dimensions

## Remarks

Any dimension settings accumulated so far WILL be wiped out. If dims is array if dimensions, they will be used as is. If it is an array whose first element is dimension generation function, then the function will be called to obtain dimensions.

This function MUST be used to implement IPreparedExecution.withDimensions(); its parameters are constructed in a way that it can handle both signatures of the withDimensions().
