# DataChangeHistoryApi

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

The history of cell value changes: the log, the latest change for a cell, and undo.

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

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [activateDataChangeHistory(forceReset)](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#activatedatachangehistory) | `void` | Activates Data Change History tracking (or resumes it, if it is currently suspended) |
| [addDataChangeHistoryEntry(dataChangeInfo)](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#adddatachangehistoryentry) | `void` | Adds item to Data Change History log |
| [clearDataChangeHistoryEntry(dataChangeInfo)](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#cleardatachangehistoryentry) | `void` | Clears a Row in Data Change Grid |
| [deactivateDataChangeHistory()](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#deactivatedatachangehistory) | `void` | Deactivates Data Change History tracking and flushes the cache |
| [getDataChangeForGridCell(gridCell)](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#getdatachangeforgridcell) | [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md)` \| undefined` | The most recent change recorded for a cell. |
| [getDataChangeHistoryLog()](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#getdatachangehistorylog) | [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md)`[]` | Retrieves all data changes which are currently available |
| [getDataChangeHistoryMode()](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#getdatachangehistorymode) | `'ACTIVE' \| 'INACTIVE' \| 'SUSPENDED'` | Retrieves current Data Change History mode: &#39;ACTIVE&#39;, &#39;INACTIVE&#39;, &#39;SUSPENDED&#39; |
| [openDataChangeHistorySettingsPanel()](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#opendatachangehistorysettingspanel) | `void` | Opens Data Change History panel |
| [suspendDataChangeHistory()](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#suspenddatachangehistory) | `void` | Suspends data change history tracking |
| [undoAllDataChangeHistoryEntries()](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#undoalldatachangehistoryentries) | [`GridCell`](https://www.adaptabletools.com/docs/reference/gridcell.md)`[]` | Reverts all data changes to previous values and returns GridCells that were undone |
| [undoDataChangeHistoryEntry(dataChangeInfo)](https://www.adaptabletools.com/docs/reference/datachangehistoryapi.md#undodatachangehistoryentry) | [`GridCell`](https://www.adaptabletools.com/docs/reference/gridcell.md)` \| undefined` | Reverts provided data change to its previous value and returns GridCell that was undone |

## Method Details

### activateDataChangeHistory

Activates Data Change History tracking (or resumes it, if it is currently suspended)

```ts title="TypeScript"
activateDataChangeHistory(forceReset?: boolean): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| forceReset | `boolean` | reactivates the Data Change History even if it is currently suspended |

###### Returns

`void`

### addDataChangeHistoryEntry

Adds item to Data Change History log

```ts title="TypeScript"
addDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataChangeInfo | [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md) | the change to log |

###### Returns

`void`

### clearDataChangeHistoryEntry

Clears a Row in Data Change Grid

```ts title="TypeScript"
clearDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataChangeInfo | [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md) | the change to be undone |

###### Returns

`void`

### deactivateDataChangeHistory

Deactivates Data Change History tracking and flushes the cache

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

###### Returns

`void`

### getDataChangeForGridCell

The most recent change recorded for a cell.

```ts title="TypeScript"
getDataChangeForGridCell(gridCell: GridCell): CellDataChangedInfo | undefined;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| gridCell | [`GridCell`](https://www.adaptabletools.com/docs/reference/gridcell.md) | Cell to look up |

###### Returns

 The most recent change recorded for a cell

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

### getDataChangeHistoryLog

Retrieves all data changes which are currently available

```ts title="TypeScript"
getDataChangeHistoryLog(): CellDataChangedInfo[];
```

###### Returns

 All data changes which are currently available

[`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md)`[]`

### getDataChangeHistoryMode

Retrieves current Data Change History mode: &#39;ACTIVE&#39;, &#39;INACTIVE&#39;, &#39;SUSPENDED&#39;

```ts title="TypeScript"
getDataChangeHistoryMode(): 'ACTIVE' | 'INACTIVE' | 'SUSPENDED';
```

###### Returns

 Current Data Change History mode: &#39;ACTIVE&#39;, &#39;INACTIVE&#39;, &#39;SUSPENDED&#39;

`'ACTIVE' | 'INACTIVE' | 'SUSPENDED'`

### openDataChangeHistorySettingsPanel

Opens Data Change History panel

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

###### Returns

`void`

### suspendDataChangeHistory

Suspends data change history tracking

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

###### Returns

`void`

### undoAllDataChangeHistoryEntries

Reverts all data changes to previous values and returns GridCells that were undone

```ts title="TypeScript"
undoAllDataChangeHistoryEntries(): GridCell[];
```

###### Returns

 Reverts all data changes to previous values and returns GridCells that were undone

[`GridCell`](https://www.adaptabletools.com/docs/reference/gridcell.md)`[]`

### undoDataChangeHistoryEntry

Reverts provided data change to its previous value and returns GridCell that was undone

```ts title="TypeScript"
undoDataChangeHistoryEntry(dataChangeInfo: CellDataChangedInfo): GridCell | undefined;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| dataChangeInfo | [`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md) | the change to be undone |

###### Returns

 Reverts provided data change to its previous value and returns GridCell that was undone

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