---
title: "Listing of label values. The resulting data are limited by the static platform limit to the maximum of 10000 rows."
method: POST
path: "/api/v1/actions/workspaces/{workspaceId}/execution/collectLabelElements"
tags: ["Computation"]
---

# Listing of label values. The resulting data are limited by the static platform limit to the maximum of 10000 rows.

`POST /api/v1/actions/workspaces/{workspaceId}/execution/collectLabelElements`

## Request

- Base URL: `https://www.gooddata.ai`
- URL: `https://www.gooddata.ai/api/v1/actions/workspaces/{workspaceId}/execution/collectLabelElements`
- Auth: none declared

Returns paged list of elements (values) of given label satisfying given filtering criteria.

## Path parameters

- `workspaceId` string, required

## Query parameters

- `offset` integer
- `limit` integer

## Headers

- `skip-cache` boolean

## Request body

- ElementsRequest
  - `cacheId` string: If specified, the element data will be taken from the result with the same cacheId if it is available.
  - `complementFilter` boolean: Inverse filters: * ```false``` - return items matching ```patternFilter``` and ```exactFilter``` * ```true``` - return items not matching ```patternFilter``` and ```exactFilter```
  - `dataSamplingPercentage` number, float: Specifies percentage of source table data scanned during the computation. This field is deprecated and is no longer used during the elements computation.
  - `dependsOn` union[]: Return only items that are not filtered-out by the parent filters.
    - union
      - DependsOn, nullable: Filter definition type specified by label and values.
        - `complementFilter` boolean: Inverse filtering mode.
        - `label` string, required: Specifies on which label the filter depends on.
        - `type` 'label' | 'computedAttribute': Type of the object ```label``` refers to. A set type is taken at its word; an unset one means a label, with a computed attribute of the same id accepted as a fallback.
        - `values` string[], required: Specifies values of the label for element filtering.
      - DependsOnDateFilter, nullable: Filter definition type for dates.
        - `dateFilter` union, required: Abstract filter definition type for dates.
          - object: A datetime filter specifying exact from and to values.
            - `absoluteDateFilter` AbsoluteDateFilterBody, required
              - …
          - object: An absolute date range filter defined at a specific granularity. The 'from'/'to' literals must match the format of the chosen granularity (e.g. '2020' for YEAR, '2012-05' for MONTH, '2012-3' for QUARTER, '1996-01' for WEEK, '2010-10-30' for DAY, '2010-10-30 13' for HOUR, '2010-10-30 13:30' for MINUTE, '2010-10-30 13:30:45' for SECOND, or a plain ordinal like '6' for periodical granularities such as MONTH_OF_YEAR). At least one of 'from'/'to' must be provided; specifying only one yields an open-ended range.
            - `absoluteGranularityDateFilter` object, required
              - …
          - object: A date filter specifying a time interval that is relative to the current date. For example, last week, next month, and so on. Field dataset is representing qualifier of date dimension. The 'from' and 'to' properties mark the boundaries of the interval. If 'from' is omitted, all values earlier than 'to' are included. If 'to' is omitted, all values later than 'from' are included. It is not allowed to omit both.
            - `relativeDateFilter` RelativeDateFilterBody, required
              - …
          - object: An all-time date filter that does not restrict by date range. Controls how rows with empty (null/missing) date values are handled.
            - `allTimeDateFilter` AllTimeDateFilterBody, required
              - …
      - DependsOnMatchFilter, nullable: Filter definition for string matching.
        - `matchFilter` MatchAttributeFilter, required: Filter via label with given match type and literal value.
          - `matchAttributeFilter` object, required
            - `applyOnResult` boolean
            - `caseSensitive` boolean: Indicates whether the filter match is evaluated in case-sensitive mode or not.
            - `label` union, required: Reference to the attribute label to which the filter should be applied.
              - …
            - `literal` string, required: Literal used to limit label values.
            - `localIdentifier` string
            - `matchType` 'STARTS_WITH' | 'ENDS_WITH' | 'CONTAINS', required: Requested match type.
            - `negate` boolean: Indicates whether the filter should negate the match.
  - `exactFilter` string[]: Return only items, whose ```label``` title exactly matches one of ```filter```.
  - `excludePrimaryLabel` boolean: Excludes items from the result that differ only by primary label * ```false``` - return items with distinct primary label * ```true``` - return items with distinct requested label
  - `filterBy` FilterBy: Specifies what is used for filtering.
    - `labelType` 'PRIMARY' | 'REQUESTED': Specifies which label is used for filtering - primary or requested.
  - `label` string, required: Requested label.
  - `patternFilter` string: Return only items, whose ```label``` title case insensitively contains ```filter``` as substring.
  - `sortOrder` 'ASC' | 'DESC': Sort order of returned items. Items are sorted by ```label``` title. If no sort order is specified then attribute's ```sortDirection``` is used, which is ASC by default
  - `timezone` string: Time zone (IANA id, e.g. "Europe/Prague") used to resolve relative date filters in ```dependsOn```. If set it takes precedence over the workspace/user time zone setting; if not set the setting is used.
  - `type` 'label' | 'computedAttribute': Type of the object ```label``` refers to. A set type is taken at its word; an unset one means a label, with a computed attribute of the same id accepted as a fallback.
  - `validateBy` ValidateByItem[]: Return only items that are computable on metric.
    - `id` string, required: Specifies entity used for valid elements computation.
    - `type` string, required: Specifies entity type which could be label, attribute, computedAttribute, fact, or metric.

## Response `200`

List of label values.

- ElementsResponse: Entity holding list of sorted & filtered label elements, related primary label of attribute owning requested label and paging.
  - `cacheId` string: The client can use this in subsequent requests (like paging or search) to get results from the same point in time as the previous request. This is useful when the underlying data source has caches disabled and the client wants to avoid seeing inconsistent results and to also avoid excessive queries to the database itself.
  - `dataType` 'INT' | 'STRING' | 'DATE' | 'NUMERIC' | 'TIMESTAMP' | 'TIMESTAMP_TZ' | 'BOOLEAN' | 'HLL': Data type of the element values, only filled for computed attributes.
  - `elements` Element[], required: List of returned elements.
    - `primaryTitle` string, required: Title of primary label of attribute owning requested label, null if the title is null or the primary label is excluded
    - `title` string, required: Title of requested label.
  - `format` AttributeFormat: Attribute format describes formatting information to effectively format attribute values when needed.
    - `locale` string, required: Format locale code like 'en-US', 'cs-CZ', etc.
    - `pattern` string, required: ICU formatting pattern like 'y', 'dd.MM.y', etc.
    - `timezone` string: Timezone for date formatting like 'America/New_York', 'Europe/Prague', etc.
  - `granularity` 'SECOND' | 'SECOND_OF_MINUTE' | 'SECOND_OF_DAY' | 'MINUTE' | 'MINUTE_OF_HOUR' | 'MINUTE_OF_DAY' | 'HOUR' | 'HOUR_OF_DAY' | 'DAY' | 'DAY_OF_WEEK' | 'DAY_OF_MONTH' | 'DAY_OF_QUARTER' | 'DAY_OF_YEAR' | 'WEEK' | 'WEEK_OF_YEAR' | 'MONTH' | 'MONTH_OF_YEAR' | 'QUARTER' | 'QUARTER_OF_YEAR' | 'YEAR' | 'FISCAL_DAY_OF_FISCAL_WEEK' | 'FISCAL_DAY_OF_FISCAL_MONTH' | 'FISCAL_DAY_OF_FISCAL_QUARTER' | 'FISCAL_DAY_OF_FISCAL_SEMESTER' | 'FISCAL_DAY_OF_FISCAL_YEAR' | 'FISCAL_WEEK' | 'FISCAL_WEEK_OF_FISCAL_MONTH' | 'FISCAL_WEEK_OF_FISCAL_QUARTER' | 'FISCAL_WEEK_OF_FISCAL_SEMESTER' | 'FISCAL_WEEK_OF_FISCAL_YEAR' | 'FISCAL_MONTH' | 'FISCAL_MONTH_OF_FISCAL_QUARTER' | 'FISCAL_MONTH_OF_FISCAL_SEMESTER' | 'FISCAL_MONTH_OF_FISCAL_YEAR' | 'FISCAL_QUARTER' | 'FISCAL_QUARTER_OF_FISCAL_SEMESTER' | 'FISCAL_QUARTER_OF_FISCAL_YEAR' | 'FISCAL_SEMESTER' | 'FISCAL_SEMESTER_OF_FISCAL_YEAR' | 'FISCAL_YEAR': Granularity of requested label in case of date attribute
  - `numberFormat` string: Format to be used to format the element values, the same kind of format string as the measure format. Only filled for computed attributes with a format and INT or NUMERIC data type.
  - `paging` Paging, required: Current page description.
    - `count` integer, required: Count of items in this page.
    - `next` string: Link to next page, or null if this is last page.
    - `offset` integer, required: Offset of this page.
    - `total` integer, required: Count of returnable items ignoring paging.
  - `primaryLabel` RestApiIdentifier, required: Object identifier.
    - `id` string, required
    - `type` string, required

---

[API](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/revisions/c728ef303bfb?raw)
