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

# changeWorkingAttributeFilterSelection()

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

Creates the ChangeAttributeFilterSelection command for working filter.

**Signature:**

```typescript
export declare function changeWorkingAttributeFilterSelection(filterLocalId: string, elements: IAttributeElements, selectionType: AttributeFilterSelectionType, correlationId?: string, isSelectionInvalid?: boolean): ChangeAttributeFilterSelection;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| filterLocalId | string | dashboard attribute filter's local id |
| elements | [IAttributeElements](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iattributeelements/index.md) | elements |
| selectionType | [AttributeFilterSelectionType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.attributefilterselectiontype/index.md) | selection type. either 'IN' or 'NOT\_IN' |
| 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 |
| isSelectionInvalid | boolean | _(Optional)_ |

**Returns:**

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

## Remarks

see [resetAttributeFilterSelection()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.resetattributefilterselection/index.md) for convenience function to select all attribute elements of  particular filter.

See also [applyAttributeFilter()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.applyattributefilter/index.md) for convenient function when you have an [IAttributeFilter](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iattributefilter/index.md) instance.

## Example

```tsx
const selectionType = isPositiveAttributeFilter ? "IN" : "NOT_IN";
```
To create this command without a need to calculate the payload values from a [IFilter](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.ifilter/index.md) object, we recommend to use [applyAttributeFilter()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.applyattributefilter/index.md) command creator instead.
