# loadNext

## Description

Loads the subsequent records in a dataset after loadData function was run.

## Input / Parameter

| Name    | Description                               | Input Type  | Default | Options | Required |
| ------- | ----------------------------------------- | ----------- | ------- | ------- | -------- |
| dataset | The name of the local table to be loaded. | String/Text | -       | -       | Yes      |

## Output

| Description                        | Output Type |
| ---------------------------------- | ----------- |
| Returns the formatted information. | Object      |

### Object

| Key     | Description                                                             | Output Type |
| ------- | ----------------------------------------------------------------------- | ----------- |
| success | Boolean value to denote whether the function was executed successfully. | Text        |
| message | The message to print.                                                   | Text        |
| data    | Any additional message or data to print.                                | Text        |

## Callback

### beforeCallback

The function to be executed if the subsequent records are loaded successfully.

## Example

In this example, we will load the next batch of data from the Local Table and display it in a flatlist component.

```js
Note: This example will only work after the user has created the data using `Dataset.insert` function.
```

### Steps

1. Make sure a `Local Table` component is created and filled on the services panel in the service page.

   ![](/files/X78QfEuUsOdOJ12JBIso)
2. Drag a button component to a page in the mobile designer.

   ![](/files/GNbixh27Cjao2aIF3vJU)
3. Drag a `flatlist` component to a page in the mobile designer, and drag a `label` component into the `flatlist` component.

   ![](/files/9Vk6IhKG0cqvfxS9RsWD)
4. Fill the `flatlist` component property in the page and fill the `label` component property in the `flatlist` component. Make sure the `label` component field value matches the key of the data that is being stored in the local table.

   ![](/files/k3mKIP106ooc6xJRyiM5)
5. Select the event `press` and drag the `Dataset.loadNext` function to the event flow. Fill in the parameters of the function.

   ![](/files/Ynt7mXRci87q17cmCf2v)

### Result

1. The next batch of data should be loaded from the local table and displayed in the flalist component.


---

# 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.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/dataset/loadnext.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.
