# Data Read Previous

{% hint style="info" %}
**Block Information**

Available in: Page Flow and Cloud Flow

Toolbox Category: Data - Read

Block Type: [Regular](https://docs.zingy.ai/app-editor/block-anatomy#regular-block)
{% endhint %}

**`Data Read Previous`** is a [regular block](https://docs.zingy.ai/app-editor/block-anatomy#regular-block) that initiates reading of the previous page of [records](https://docs.zingy.ai/data/database-tables#table-records) from a [database table](https://docs.zingy.ai/app-editor/data/database-tables).

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FdQ7EVFwIpeWG972xoJaq%2Fimage.png?alt=media&#x26;token=9edfea6e-6c85-40b3-bcd1-1bed0084d252" alt="" width="254"><figcaption><p>Data Read Previous block</p></figcaption></figure></div>

The block consists of the following (from top to bottom):

* *Table:* [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the name of the [Database Table](https://docs.zingy.ai/app-editor/data/database-tables) .
* *Dataset Name:* [Value Parameter](https://docs.zingy.ai/app-editor/block-anatomy#value-parameters) that accepts a [*text*](https://docs.zingy.ai/app-editor/page-flow/references/value-types) value representing the name of the dataset.

{% hint style="success" %}
**NOTE**:&#x20;

* This block only functions if a previous database read, using a [Data Read](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-read) or a [Data Read Next](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-read-next) block, for the same table and dataset, was initiated and completed.
* The same database *Query* with input parameters and *Per Page* values that were provided with the [Data Read](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-read) block will be used here.
* This block initiates the database read, which will occur in the background. To track the status and to take an action upon completion of the read, use the [Data Status](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-status) block.&#x20;
* To access the records after a successful read, see [Data Record Count](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-record-count), [Data Record Loop](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-record-loop), [Data Record at Index](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-record-at-index) blocks.
  {% endhint %}

***

## Usage Example

{% hint style="info" %}
**NOTE: Please refer to the prerequisite information shown** [**here**](https://docs.zingy.ai/app-editor/page-flow/references/prerequisite-for-data-examples) **before seeing the example.**&#x20;
{% endhint %}

The image below shows an example of the **`Data Read Previous`** block.

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FZK5DAjlksPKa3XIETAQE%2Fimage.png?alt=media&#x26;token=f04e16a5-1b78-493b-8d3a-bbeeae86d5f8" alt="" width="519"><figcaption><p>Data Read Previous example</p></figcaption></figure></div>

Here is a summary of the above example:

* The [Mouse/Keyboard Action](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/mouse-keyboard-action) block is used to handle a button click.
* When the button is clicked, the **`Data Read Previous`** block is used to initiate a read for the next page.
* The [Data Status](https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-status) block is used to track the status of the read and upon success,  the *do something* function is invoked.
