refresh( )


Refetches the contents of the dataset from the collection.

The refresh() function returns a Promise that is resolved when:

  • The dataset's contents are refetched from the collection, discarding current edits.
  • Any connected page elements have been updated with the values from the collection (read & write mode) or blank values (write-only mode).

Refreshing the dataset sets the current item back to the first item in the dataset regardless of what the current item was before refreshing.

Note:

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

To call refresh() 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.

Method Declaration
Copy
Request
This method does not take any parameters
Did this help?