Search.../

hasNextPage( )

Indicates if there is a next page of data.

Description

Returns true if the current page is not the last page in the dataset.

Returns false if the current page is the last page in the dataset.

Calling hasNextPage() on a write-only dataset causes an error.

Note:

A dataset needs to load its data before you call its hasNextPage() function. Usually a dataset finishes loading a short time after the page it is on finishes loading. So if you call hasNextPage() inside the page’s onReady() event handler, the dataset might not be ready yet.

To call hasNextPage() as soon as possible after a page loads, use the dataset's onReady() function inside the page’s onReady() event handler to ensure that both the page and the dataset have finished loading.

Authorization

Request

This endpoint does not take any parameters

Response Object

true if the current page is not the last page in the dataset.

Returns an empty object.

Status/Error Codes

Was this helpful?

Get whether the current page is the last page of data

Copy Code
1let hasNextPage = $w("#myDataset").hasNextPage(); // true
Get whether the current page is the last page of data when the page loads

Copy Code
1$w.onReady( () => {
2 $w("#myDataset").onReady( () => {
3 let hasNextPage = $w("#myDataset").hasNextPage(); // true
4
5 } );
6
7} );