> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/global/getpreviouspage.md).

# getPreviousPage

## Description

Returns the name of the page the user was on before the current page.

## Input / Parameter

N/A

## Output

| Description                            | Output Type |
| -------------------------------------- | ----------- |
| Returns the name of the previous page. | String/Text |

## Callback

N/A

## Video

Coming Soon.

## Example

The user wants to get the name of the previous page they were on.

### Steps

| No. | Description                                                                                                                                                                                                          |                                                                                                                                             |
| --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| 1.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-41f3b6bcc7badb490cc1d18772517e289888399a%2FgetPreviousPage-step-1.png?alt=media) | Drag a button to a page in the mobile designer. Select the event `click` for the button and drag the `gotoPage` function to the event flow. |
| 2.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-c9c11bad61d6fbcf3b7a1fecd9cb1d5316fea6a4%2FgetPreviousPage-step-2.png?alt=media) | Fill in the parameters of the function.                                                                                                     |
| 3.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-85c2f3b61a3342ce81fee57d9b07eb6fa292fae1%2FgetPreviousPage-step-3.png?alt=media) | Drag the `console` function to the node below the `gotoPage` function.                                                                      |
| 4.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-bcda2f0add49cc74b9e8c07d397d45e96e569535%2FgetPreviousPage-step-4.png?alt=media) | Select the `function` parameter input type for the value parameter.                                                                         |
| 5.  | ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-bb6d452861405bd7203f8752d69a605c4692bb25%2FgetPreviousPage-step-5.png?alt=media) | Drag the `getPreviousPage` function to the node in the subflow.                                                                             |

### Result

When the button is pressed, the page will navigate to pgWelcome and the console will show the name of the previous page.

## Links
