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

# AttributeBuilder

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

Builder for attributes.

Do not instantiate this class directly. Instead use [newAttribute()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.newattribute/index.md) or [modifyAttribute()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.modifyattribute/index.md).

**Signature:**

```typescript
export declare class AttributeBuilder 
```

## Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `AttributeBuilder` class.

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [alias](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.attributebuilder/index.md#attributebuilderalias) |  | (alias?: string) =&gt; this | Sets alias - alternative title - for the attribute. |
| [build](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.attributebuilder/index.md#attributebuilderbuild) |  | () =&gt; [IAttribute](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iattribute/index.md) | Creates the IAttribute instance. |
| [defaultLocalId](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.attributebuilder/index.md#attributebuilderdefaultlocalid) |  | () =&gt; this | Indicates that the attribute's localId should be generated using the default local-id generator logic. |
| [displayForm](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.attributebuilder/index.md#attributebuilderdisplayform) |  | (ref: [ObjRef](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.objref/index.md)) =&gt; this | Sets display form reference. |
| [localId](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.attributebuilder/index.md#attributebuilderlocalid) |  | (localId?: [Identifier](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.identifier/index.md)) =&gt; this | Sets local identifier (localId) for the attribute. LocalId can be used to reference the attribute within the execution definition. Normally, builder will generate localId based on contents of the attribute definition - taking all properties into account: in typical scenarios you don't have to call this function at all. The only exception where you have to provide custom local id is if your execution must contain the exact same attribute twice. For convenience, this method also accepts 'undefined', which indicates that the default local id generation logic should be used. |
| [noAlias](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.attributebuilder/index.md#attributebuildernoalias) |  | () =&gt; this | Resets alias - alternative title - set for the attribute. |
| [showAllValues](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.attributebuilder/index.md#attributebuildershowallvalues) |  | (showAllValues?: boolean) =&gt; this | Sets show all values property. |

## Property details

### AttributeBuilder.alias

Sets alias - alternative title - for the attribute.

**Signature:**

```typescript
alias: (alias?: string) => this;
```

#### Remarks

This value will then be used in various chart-specific descriptive elements. For convenience if no alias is specified, the attribute will fall back to server-defined value.

### AttributeBuilder.build

Creates the IAttribute instance.

**Signature:**

```typescript
build: () => IAttribute;
```

### AttributeBuilder.defaultLocalId

Indicates that the attribute's localId should be generated using the default local-id generator logic.

**Signature:**

```typescript
defaultLocalId: () => this;
```

### AttributeBuilder.displayForm

Sets display form reference.

**Signature:**

```typescript
displayForm: (ref: ObjRef) => this;
```

### AttributeBuilder.localId

Sets local identifier (localId) for the attribute. LocalId can be used to reference the attribute within the execution definition.

Normally, builder will generate localId based on contents of the attribute definition - taking all properties into account: in typical scenarios you don't have to call this function at all. The only exception where you have to provide custom local id is if your execution must contain the exact same attribute twice.

For convenience, this method also accepts 'undefined', which indicates that the default local id generation logic should be used.

**Signature:**

```typescript
localId: (localId?: Identifier) => this;
```

### AttributeBuilder.noAlias

Resets alias - alternative title - set for the attribute.

**Signature:**

```typescript
noAlias: () => this;
```

#### Remarks

The server-defined title of the attribute will be used instead.

### AttributeBuilder.showAllValues

Sets show all values property.

**Signature:**

```typescript
showAllValues: (showAllValues?: boolean) => this;
```

#### Remarks

The flag showAllValues translates to a property of the same name on the attribute in execution definition. If truthy, the backend will return all values of the particular attribute in the execution response even if there are no data available for it.
