# Data Change History Technical Reference

Canonical page: https://www.adaptabletools.com/docs/technical-reference-monitoring-data-change-history

## Data Change History Options

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [activeByDefault](https://www.adaptabletools.com/docs/reference/datachangehistoryoptions.md#activebydefault) | `boolean` | Make Data Change History active by default | false |
| [changeHistoryButton](https://www.adaptabletools.com/docs/reference/datachangehistoryoptions.md#changehistorybutton) | [`DataChangeHistoryButton`](https://www.adaptabletools.com/docs/reference/datachangehistorybutton.md)`<TData> \| `[`DataChangeHistoryButton`](https://www.adaptabletools.com/docs/reference/datachangehistorybutton.md)`<TData>[]` | Action button definition; can be used to implement undo functionality | undefined |
| [maxDataChangesInStore](https://www.adaptabletools.com/docs/reference/datachangehistoryoptions.md#maxdatachangesinstore) | `number` | How many data changes are held in State at any one time; when limit is reached, oldest change(s) are deleted from memory | undefined (all data changes are logged) |
| [showDataChange](https://www.adaptabletools.com/docs/reference/datachangehistoryoptions.md#showdatachange) | `(cellDataChangedInfo: `[`CellDataChangedInfo`](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md)`<TData>) => boolean` | Function specifying which data changes to include in Data Change History | undefined (all data changes are logged) |
| [showLastDataChangeOnly](https://www.adaptabletools.com/docs/reference/datachangehistoryoptions.md#showlastdatachangeonly) | `boolean` | Show all changes for a Cell or just the last one | true |

`changeHistoryButton` is a list of [`DataChangeHistoryButton`](https://www.adaptabletools.com/docs/reference/datachangehistorybutton.md) objects:

| Property | Type | Description |
| --- | --- | --- |
| [action](https://www.adaptabletools.com/docs/reference/datachangehistorybutton.md#action) | [`AdaptableDataChangeHistoryAction`](https://www.adaptabletools.com/docs/reference/adaptabledatachangehistoryaction.md) | Built-in action the button runs. `'undo'` restores the previous value. `'clear'` removes the change from the log. |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/datachangehistorybutton.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

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

| Property | Type | Description |
| --- | --- | --- |
| [changedAt](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#changedat) | `number` | Timestamp of change occurrence (in milliseconds) |
| [column](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#column) | [`AdaptableColumn`](https://www.adaptabletools.com/docs/reference/adaptablecolumn.md)`<TData>` | Column in which cell is situated |
| [newValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#newvalue) | `any` | Value after the change.<br/><br/>Absent when `trigger` is `live`. |
| [oldValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#oldvalue) | `any` | Value before the change.<br/><br/>Absent when `trigger` is `live`. |
| [preventEdit](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#preventedit) | `boolean` | Whether the change was prevented by a validation rule |
| [primaryKeyValue](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#primarykeyvalue) | `any` | Primary Key Column&#39;s value for the row where edited cell is situated |
| [rowData](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#rowdata) | `TData` | Data in the Row |
| [rowNode](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#rownode) | `IRowNode<TData>` | AG Grid RowNode that contains the cell |
| [trigger](https://www.adaptabletools.com/docs/reference/celldatachangedinfo.md#trigger) | `'edit' \| 'tick' \| 'undo' \| 'aggChange' \| 'calculatedColumnChange' \| 'live'` | What triggered the change - user, background change, a reverted change, a<br/>derived update on a Calculated Column whose source value changed, or a<br/>live Alert rule turning true for the row (`live`: no old / new value,<br/>`column` is the rule&#39;s first Scope column when it has one). |

---------

## Data Change History API

| 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 |
