previous( )

Saves the current item and moves to the previous item.

The previous() function returns a Promise that is resolved to the previous item when:

  • The current item is saved in the collection (if necessary).
  • Any connected page elements have been updated with the new current item’s values.

Calling previous() on a write-only dataset causes the Promise to reject.

If the dataset is read-write, the current item is saved even if there is no previous item.


  • A dataset needs to load its data before you call its previous() function.

    Usually a dataset finishes loading a short time after the page it is on finishes loading. So if you call previous() inside the page’s onReady() event handler, the dataset might not be ready yet.

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

  • When using a read-write dataset and linked input elements, calling any of the following functions will save any changes made in the linked input elements.

Method Declaration
This method does not take any parameters
Return Type:Promise<object>
Was this helpful?