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

# IElementsQueryOptions

- Package: [@gooddata/sdk-backend-spi](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/index.md)
- Kind: interface
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-backend-spi/src/workspace/attributes/elements/index.ts

Configuration options for querying attribute elements

**Signature:**

```typescript
export interface IElementsQueryOptions 
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [cacheId?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ielementsqueryoptions/index.md#ielementsqueryoptionscacheid) |  | string | _(Optional)_ Cache ID to use when requesting subsequent elements from the backend. |
| [complement?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ielementsqueryoptions/index.md#ielementsqueryoptionscomplement) |  | boolean | _(Optional)_ If true, the `filter` prop will behave negatively - i.e. it will not include items matching the `filter` value. |
| [elements?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ielementsqueryoptions/index.md#ielementsqueryoptionselements) |  | [ElementsQueryOptionsElementsSpecification](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.elementsqueryoptionselementsspecification/index.md) | _(Optional)_ Specify particular elements to load. |
| [excludePrimaryLabel?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ielementsqueryoptions/index.md#ielementsqueryoptionsexcludeprimarylabel) |  | boolean | _(Optional)_ Decides whether result will include also the primary label elements or only requested label ones. It changes also the cardinality of result. If true, returned label values are in cardinality of primary label, i.e., result could contain duplicated values. If false, returned label values are unique values and smaller amount of label values can be returned than the number of primary label values. |
| [filter?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ielementsqueryoptions/index.md#ielementsqueryoptionsfilter) |  | string | _(Optional)_ Filter elements by text value |
| [filterByPrimaryLabel?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ielementsqueryoptions/index.md#ielementsqueryoptionsfilterbyprimarylabel) |  | boolean | _(Optional)_ Provided filter uses values from primary label. |
| [includeTotalCountWithoutFilters?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ielementsqueryoptions/index.md#ielementsqueryoptionsincludetotalcountwithoutfilters) |  | boolean | _(Optional)_ Include the total count of all elements in the response (without filters applied) |
| [order?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.ielementsqueryoptions/index.md#ielementsqueryoptionsorder) |  | [SortDirection](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.sortdirection/index.md) | _(Optional)_ Ordering of the elements |

## Property details

### IElementsQueryOptions.cacheId

Cache ID to use when requesting subsequent elements from the backend.

**Signature:**

```typescript
cacheId?: string;
```

#### Remarks

This is to prevent inconsistent results when the underlying datasource is volatile. If not specified, the backend will generate a value that the client should use in subsequent requests. Note that not all backend types support this.

### IElementsQueryOptions.complement

If true, the `filter` prop will behave negatively - i.e. it will not include items matching the `filter` value.

**Signature:**

```typescript
complement?: boolean;
```

### IElementsQueryOptions.elements

Specify particular elements to load.

**Signature:**

```typescript
elements?: ElementsQueryOptionsElementsSpecification;
```

#### Remarks

This is commonly used to preload selected elements in the attribute filter.

### IElementsQueryOptions.excludePrimaryLabel

Decides whether result will include also the primary label elements or only requested label ones. It changes also the cardinality of result.

If true, returned label values are in cardinality of primary label, i.e., result could contain duplicated values.

If false, returned label values are unique values and smaller amount of label values can be returned than the number of primary label values.

**Signature:**

```typescript
excludePrimaryLabel?: boolean;
```

#### Remarks

This is used mainly in filters to not display duplicate values where each of them filter out the same records from an insight when text value attribute filters are used.

The value is applied only on backends without the supportsElementUris capability.

### IElementsQueryOptions.filter

Filter elements by text value

**Signature:**

```typescript
filter?: string;
```

### IElementsQueryOptions.filterByPrimaryLabel

Provided filter uses values from primary label.

**Signature:**

```typescript
filterByPrimaryLabel?: boolean;
```

#### Remarks

This is to allow getting elements of requested label corresponding to primary label values in filter.

### IElementsQueryOptions.includeTotalCountWithoutFilters

Include the total count of all elements in the response (without filters applied)

**Signature:**

```typescript
includeTotalCountWithoutFilters?: boolean;
```

### IElementsQueryOptions.order

Ordering of the elements

**Signature:**

```typescript
order?: SortDirection;
```
