# Data Record at Index

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

Available in: Page Flow and Cloud Flow

Toolbox Category: Data

Block Type: [Output](/app-editor/page-flow/block-anatomy.md#output-block)

Output Type: [*object*](/app-editor/page-flow/references/value-types.md)
{% endhint %}

**`Data Record at Index`** is an [output block](/app-editor/page-flow/block-anatomy.md#output-block) that provides an object representing the [record](/app-editor/data/database-tables.md#table-records) at a specified index, after a successful read operation by the [Data Read](/app-editor/page-flow/toolbox-blocks/data-read.md), [Data Read Next Page](/app-editor/page-flow/toolbox-blocks/data-read-next.md) and [Data Read Previous Page](/app-editor/page-flow/toolbox-blocks/data-read-previous.md) blocks.

{% hint style="warning" %}
NOTE: This block will provide valid values only after the [Data Read](/app-editor/page-flow/toolbox-blocks/data-read.md), [Data Read Next Page](/app-editor/page-flow/toolbox-blocks/data-read-next.md) and [Data Read Previous Page](/app-editor/page-flow/toolbox-blocks/data-read-previous.md) blocks complete their execution. The [Data Status](/app-editor/page-flow/toolbox-blocks/data-status.md) block can be used to track the completion.
{% endhint %}

<div align="left"><figure><img src="/files/F5lN5OggpUayDjlSsPRU" alt="" width="267"><figcaption><p>Data Record at Index block</p></figcaption></figure></div>

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

* *Table:* [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts a [*text*](/app-editor/page-flow/references/value-types.md) value representing the name of the [Database Table](/app-editor/data/database-tables.md) .
* *Dataset Name:* [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts a [*text*](/app-editor/page-flow/references/value-types.md) value representing the name of the dataset on which a database read was conducted using the Data Read, Data Read Next Page and Data Read Previous Page blocks.
* *Index*: [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts a [*numeric*](/app-editor/page-flow/references/value-types.md) integer values representing the index for which you want the data. The valid values are for the index are from *0* to *Number\_of\_records\_Read - 1.* More on this topic below.

***

## Index&#x20;

The index used to retrieve the data uses [zero-based numbering](https://en.wikipedia.org/wiki/Zero-based_numbering). Hence the valid values start at *0* and end at *1 less than* the total count.

e.g. If the number of records read was *10*, then the valid values are from *0* through *9*.

***

## Usage Example

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

The image below shows an example of the **`Data Record at Index`** block. This example incorporates the *Usage Example* function, as outlined in the [Database Reading Logic for examples section](/app-editor/page-flow/references/prerequisite-for-data-examples.md#database-reading-logic-for-examples) on the prerequisite information page mentioned above.

<figure><img src="/files/chCvr1JNUCPWIZ4k2Sc4" alt=""><figcaption><p>Example of <strong><code>Data Record at Index</code></strong> block</p></figcaption></figure>

* To begin, the output of the [Data Record Count](/app-editor/page-flow/toolbox-blocks/data-record-count.md) block is assigned to the variable ***`a`***. Note that the *Customers* [Database Table](/app-editor/data/database-tables.md) along with the dataset name of *ds1* are used for the [Value Parameters](/app-editor/page-flow/block-anatomy.md#value-parameters) .
* The **`If`** block to confirm that the value of the variable *a* (number of records read) was at-least ***`1`*** .
* The output of our **`Data Record at Index`** block is assigned to the variable ***`b`*** .  Again note that the *Customers* [Database Table](/app-editor/data/database-tables.md) along with the dataset name of *ds1* and *Index* set to the value *0*, are used for the [Value Parameters](/app-editor/page-flow/block-anatomy.md#value-parameters) .
* The [Show Information Popup](/app-editor/page-flow/toolbox-blocks/show-information-popup.md) block is used to display the values of the *FirstName* and *LastName* properties of variable ***`b`*** .

The result for the above example is shown in the image below.

<figure><img src="/files/AVRS5x8TaZzpINbydXBb" alt=""><figcaption><p>Result of the example for the Data Record at Index block</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zingy.ai/app-editor/page-flow/toolbox-blocks/data-record-at-index.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
