Determine the Attribute Value ID

Every object in the GoodData platform has its own unique ID. This topic describes how you can find the ID of an attribute value.

Contents:

Attribute Labels and Attribute Values

An attribute has one or more attribute labels. An attribute label (also known as displayForm) provides a different means of representing an attribute. For example, when you choose a label for the Department attribute, you define how you want the attribute values (the company departments) to be displayed:

  • With their full names: Human Resources, Research and Development, Quality Assurance
  • With their shortened names: HR, RD, QA
  • As numbers from 1 to 3, where 1 is Human Resources, 2 is Research and Development, and 3 is Quality Assurance

Every attribute value has its own unique ID, and it is different from the ID of the attribute itself.

AttributeAttribute LabelAttribute Values

Department

(ID=15)

Full names

Human Resources (ID=16)

Research and Development (ID=17)

Quality Assurance (ID=18)

Shortened names

HR (ID=19)

RD (ID=20)

QA (ID=21)

Numbers

1 (ID=22)

2 (ID=23)

3 (ID=24)

When You Need to Know an Attribute Value ID

You need the ID of an attribute value to set up data permissions (see Data Permissions).

The data permission filter expression looks something like the following:

[/gdc/md/<project_id>/obj/<attribute_id>]=[/gdc/md/<project_id>/obj/<attribute_id>/elements?id=<attribute_value_id>]

Example:
You want to filter reports by a specific department for a specific user. You know the name of the department (which is a value of the Department project attribute). The name is Research and Development. You need to find out the ID of the Research and Development department (which is the attribute value ID).

Determine the Attribute Value ID

This procedure assumes that you access your projects at https://secure.gooddata.com/.

If you are a white-labeled customer, replace secure.gooddata.com with your white-labeled domain in the procedure steps.

Steps:

  1. Go to the following page:

    https://secure.gooddata.com/labs/apps/ui-developer-toolkit/build/index.html#/metadata

    The metadata browser opens.

  2. From the project dropdown, select the project that the attribute belongs to.
  3. From the metadata category dropdown, select Attributes.
    All project attributes are displayed.
  4. Click the attribute whose value ID you want to find out.
    The attribute details are displayed on the right.

  5. On the Preview tab, click the label (displayForm) that the attribute label belongs to.
    The attribute values of that label are displayed.

  6. Locate the attribute value whose ID you want to find out. The ID keyword in the attribute value URI identifies the value ID.
    For example, in the following picture, the selected attribute (1) is Month/Year (OpptyCreationDate) (2). In the Short (Jan) label (3), the ID of the Apr attribute value is 4.

Powered by Atlassian Confluence and Scroll Viewport.