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.


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.


function refresh(): Promise<void>

refresh Parameters

This function does not take any parameters.


Fulfilled - When the refresh is finished. Rejected - An error message.

Return Type:


Related Content:

Was this helpful?

Refresh the dataset contents

Copy Code
2 .then( () => {
3 console.log("Done refreshing the dataset");
4 } );
Refresh the dataset contents when the page loads

Copy Code
1$w.onReady( () => {
2 $w("#myDataset").onReady( () => {
3 $w("#myDataset").refresh()
4 .then( () => {
5 console.log("Done refreshing the dataset");
6 } );
8 } );
10} );