# DataSetApi

Canonical page: https://www.adaptabletools.com/docs/reference/datasetapi

Provides run-time access to Data Sets

```ts title="TypeScript"
export interface DataSetApi 
```

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [clearCurrentDataSet()](https://www.adaptabletools.com/docs/reference/datasetapi.md#clearcurrentdataset) | `void` | Clears currently selected Data Set |
| [getCurrentDataSet()](https://www.adaptabletools.com/docs/reference/datasetapi.md#getcurrentdataset) | [`DataSet`](https://www.adaptabletools.com/docs/reference/dataset.md)` \| undefined` | Retrieves the currently applied Data Set |
| [getDataSetByName(dataSetName)](https://www.adaptabletools.com/docs/reference/datasetapi.md#getdatasetbyname) | [`DataSet`](https://www.adaptabletools.com/docs/reference/dataset.md) | Retrieves Data Set from State with given name |
| [getDataSets()](https://www.adaptabletools.com/docs/reference/datasetapi.md#getdatasets) | [`DataSet`](https://www.adaptabletools.com/docs/reference/dataset.md)`[]` | Retrieves the Data Sets from Data Set Options |
| [openDataSetSettingsPanel()](https://www.adaptabletools.com/docs/reference/datasetapi.md#opendatasetsettingspanel) | `void` | Opens Settings Panel with Data Set section selected and visible |
| [setDataSet(dataSetName)](https://www.adaptabletools.com/docs/reference/datasetapi.md#setdataset) | `void` | Loads the given Data Set (makes it the Current one) |

## Method Details

### clearCurrentDataSet

Clears currently selected Data Set

```ts title="TypeScript"
clearCurrentDataSet(): void;
```

###### Returns

`void`

### getCurrentDataSet

Retrieves the currently applied Data Set

```ts title="TypeScript"
getCurrentDataSet(): DataSet | undefined;
```

###### Returns

 data Set

[`DataSet`](https://www.adaptabletools.com/docs/reference/dataset.md)` | undefined`

### getDataSetByName

Retrieves Data Set from State with given name

```ts title="TypeScript"
getDataSetByName(dataSetName: string): DataSet;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataSetName | `string` | name of Data Set to retrieve |

###### Returns

 data Set

[`DataSet`](https://www.adaptabletools.com/docs/reference/dataset.md)

### getDataSets

Retrieves the Data Sets from Data Set Options

```ts title="TypeScript"
getDataSets(): DataSet[];
```

###### Returns

 data Sets

[`DataSet`](https://www.adaptabletools.com/docs/reference/dataset.md)`[]`

### openDataSetSettingsPanel

Opens Settings Panel with Data Set section selected and visible

```ts title="TypeScript"
openDataSetSettingsPanel(): void;
```

###### Returns

`void`

### setDataSet

Loads the given Data Set (makes it the Current one)

```ts title="TypeScript"
setDataSet(dataSetName: string): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataSetName | `string` | Name of Data Set to load |

###### Returns

`void`
