# Data Lookup

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

Available in: Page Flow and Cloud Flow

Toolbox Category: Data - Read

Block Type: [Regular](/app-editor/page-flow/block-anatomy.md#regular-block)
{% endhint %}

**`Data Lookup`** is a [regular block](/app-editor/page-flow/block-anatomy.md#regular-block) that triggers the search for a [record](/app-editor/data/database-tables.md#table-records) from a [database table](/app-editor/data/database-tables.md). The search operation is carried out using criteria that include values for the unique field (or fields) of the table.

<div align="left"><figure><img src="/files/4hew54fhJArxe94sVfrf" alt="" width="194"><figcaption><p>Data Lookup 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. This can be any text value and can later be used to track the completion of the read.
* *Criteria*: [Value Parameter](/app-editor/page-flow/block-anatomy.md#value-parameters) that accepts an [object](/app-editor/page-flow/references/value-types.md) value containing the search criteria. The Object block is pre-attached by default and its properties are automatically populated based on the unique fields of the selected table.

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

* This block initiates the database search, which will occur in the background. To track the status and to take an action upon completion of the search, use the [Data Status](/app-editor/page-flow/toolbox-blocks/data-status.md) block.&#x20;
* To access the record after a successful search, use the [Data Record Info](/app-editor/page-flow/toolbox-blocks/data-record-info.md) block.
  {% endhint %}

***

## 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 Lookup`** block where a search is conducted on the *Customers* database table which we have discussed [here](/app-editor/page-flow/references/prerequisite-for-data-examples.md).&#x20;

<figure><img src="/files/OBah50oI6Ge2HzsVowH6" alt=""><figcaption><p>Example of Data Lookup</p></figcaption></figure>

As the *Customers* database table has a single unique field *CustomerID*, the Criteria value parameter is linked to an object with its *CustomerID* property assigned to the desired search value, which is *2* in this scenario.

To track the completion of this search operation, we use the [Data Status](/app-editor/page-flow/toolbox-blocks/data-status.md) block. When the search completes successfully, we use the [Data Record Info](/app-editor/page-flow/toolbox-blocks/data-record-info.md) block to retrieve the *FirstName* and *LastName* fields and display that using the [Show Information Popup](/app-editor/page-flow/toolbox-blocks/show-information-popup.md) block.

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

<figure><img src="/files/AtKeJfi9M5qAxaIrxYhr" alt=""><figcaption><p>Result for the Data Lookup block example</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-lookup.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.
