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

# IAttributeLoader

- Package: [@gooddata/sdk-ui-filters](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/index.md)
- Kind: interface
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-filters/src/AttributeFilterHandler/types/attributeLoader.ts

Handles the loading of the attribute metadata.

**Signature:**

```typescript
export interface IAttributeLoader 
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [onLoadAttributeCancel](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloaderonloadattributecancel) |  | [CallbackRegistration](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.callbackregistration/index.md)&lt;[OnLoadAttributeCancelCallbackPayload](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.onloadattributecancelcallbackpayload/index.md)&gt; | Registers a callback that will be fired when the attribute load was canceled. Returns unsubscribe function, that will unregister it. |
| [onLoadAttributeError](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloaderonloadattributeerror) |  | [CallbackRegistration](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.callbackregistration/index.md)&lt;[OnLoadAttributeErrorCallbackPayload](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.onloadattributeerrorcallbackpayload/index.md)&gt; | Registers a callback that will be fired when error is thrown during the attribute load. Returns unsubscribe function, that will unregister it. |
| [onLoadAttributeStart](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloaderonloadattributestart) |  | [CallbackRegistration](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.callbackregistration/index.md)&lt;[OnLoadAttributeStartCallbackPayload](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.onloadattributestartcallbackpayload/index.md)&gt; | Registers a callback that will be fired when the attribute load starts. Returns unsubscribe function, that will unregister it, once called. Multiple callbacks can be registered by this function. |
| [onLoadAttributeSuccess](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloaderonloadattributesuccess) |  | [CallbackRegistration](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.callbackregistration/index.md)&lt;[OnLoadAttributeSuccessCallbackPayload](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.onloadattributesuccesscallbackpayload/index.md)&gt; | Registers a callback that will be fired when the attribute load is successfuly completed. Returns unsubscribe function, that will unregister it. |

## Methods

| Method | Description |
| --- | --- |
| [cancelAttributeLoad()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloadercancelattributeload) | Cancels the running attribute load, if any. |
| [getAttribute()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloadergetattribute) | Returns the loaded attribute. |
| [getAttributeError()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloadergetattributeerror) | Returns error, if it was thrown during the attribute filter load, undefined otherwise. |
| [getAttributeStatus()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloadergetattributestatus) | Returns the current status of the attribute filter load. |
| [loadAttribute(correlation)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.iattributeloader/index.md#iattributeloaderloadattribute) | Loads the metadata object for the attribute, that is used in the attribute filter. |

## Property details

### IAttributeLoader.onLoadAttributeCancel

Registers a callback that will be fired when the attribute load was canceled. Returns unsubscribe function, that will unregister it.

**Signature:**

```typescript
onLoadAttributeCancel: CallbackRegistration<OnLoadAttributeCancelCallbackPayload>;
```

#### Remarks

Multiple callbacks can be registered by this function.

### IAttributeLoader.onLoadAttributeError

Registers a callback that will be fired when error is thrown during the attribute load. Returns unsubscribe function, that will unregister it.

**Signature:**

```typescript
onLoadAttributeError: CallbackRegistration<OnLoadAttributeErrorCallbackPayload>;
```

#### Remarks

Multiple callbacks can be registered by this function.

### IAttributeLoader.onLoadAttributeStart

Registers a callback that will be fired when the attribute load starts. Returns unsubscribe function, that will unregister it, once called.

Multiple callbacks can be registered by this function.

**Signature:**

```typescript
onLoadAttributeStart: CallbackRegistration<OnLoadAttributeStartCallbackPayload>;
```

### IAttributeLoader.onLoadAttributeSuccess

Registers a callback that will be fired when the attribute load is successfuly completed. Returns unsubscribe function, that will unregister it.

**Signature:**

```typescript
onLoadAttributeSuccess: CallbackRegistration<OnLoadAttributeSuccessCallbackPayload>;
```

#### Remarks

Multiple callbacks can be registered by this function.

## Method details

### IAttributeLoader.cancelAttributeLoad()

Cancels the running attribute load, if any.

**Signature:**

```typescript
cancelAttributeLoad(): void;
```
**Returns:**

void

### IAttributeLoader.getAttribute()

Returns the loaded attribute.

**Signature:**

```typescript
getAttribute(): IAttributeMetadataObject | undefined;
```
**Returns:**

[IAttributeMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iattributemetadataobject/index.md) &#124; undefined

#### Remarks

Returns undefined, if the attribute is not loaded yet.

### IAttributeLoader.getAttributeError()

Returns error, if it was thrown during the attribute filter load, undefined otherwise.

**Signature:**

```typescript
getAttributeError(): GoodDataSdkError | undefined;
```
**Returns:**

[GoodDataSdkError](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.gooddatasdkerror/index.md) &#124; undefined

### IAttributeLoader.getAttributeStatus()

Returns the current status of the attribute filter load.

**Signature:**

```typescript
getAttributeStatus(): AsyncOperationStatus;
```
**Returns:**

[AsyncOperationStatus](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.asyncoperationstatus/index.md)

### IAttributeLoader.loadAttribute()

Loads the metadata object for the attribute, that is used in the attribute filter.

**Signature:**

```typescript
loadAttribute(correlation?: Correlation): void;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| correlation | [Correlation](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-filters/sdk-ui-filters.correlation/index.md) | _(Optional)_ correlation that will be included in all callbacks fired by this method |

**Returns:**

void

#### Remarks

Cancels the running attribute filter load, if any, and starts it again.

You can provide a correlation that will be included in the payload of all callbacks fired as a result of calling this method.
