# Values

A class for providing values for use with {@link VariableInputType.SELECT} and {@link VariableInputType.RADIO} dashboard variables.

- Source: [`aws-cloudwatch/lib/variable.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudwatch/lib/variable.ts#L85)
- Type last changed: v2.88.0 · 20 Jul 2023

## Example

```ts
import * as cw from 'aws-cdk-lib/aws-cloudwatch';

const dashboard = new cw.Dashboard(this, 'Dash', {
  defaultInterval: Duration.days(7),
  variables: [new cw.DashboardVariable({
    id: 'region',
    type: cw.VariableType.PROPERTY,
    label: 'Region',
    inputType: cw.VariableInputType.RADIO,
    value: 'region',
    values: cw.Values.fromValues({ label: 'IAD', value: 'us-east-1' }, { label: 'DUB', value: 'us-west-2' }),
    defaultValue: cw.DefaultValue.value('us-east-1'),
    visible: true,
  })],
});
```

## Initializer

```ts
new Values()
```

## Methods

- `fromSearch(expression: string, populateFrom: string): Values // chainable` (static) — Create values from a search expression.

  **Parameters**

  - `expression` — search expression that specifies a namespace, dimension name(s) and a metric name.
  - `populateFrom` — dimension the dimension name, that the search expression retrieves, whose values will be used to populate the values to choose from.

- `fromSearchComponents(components: SearchComponents): Values // chainable` (static) — Create values from the components of search expression.

- `fromValues(...values: VariableValue[]): Values // chainable` (static) — Create values from an array of possible variable values.

- `toJson(): any`
