# \[Solved\] How do I programmatically navigate to the previous screen?

**URL:** <https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962>\
**Category:** Questions about Thunkable X\
**Created:** [September 30, 2022, 6:45am UTC](https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962 "2022-09-30T06:45:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kinhangyu](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kinhangyu](https://community.thunkable.com/u/kinhangyu)\
**Post date:** [September 30, 2022, 6:45am UTC](https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962/1 "2022-09-30T06:45:50Z")

</div>

now my project have the 4 page(1,2,3,cat) , in (1,2,3)page have a button to navigate to cat page. if in page 1 click the button to cat page, i want go back to previous page(page1). if in page 2 click the button to cat page, at the same time can go back to previous page(page2) How to do that

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [September 30, 2022, 3:02pm UTC](https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962/2 "2022-09-30T15:02:09Z")

</div>

When you navigate to the cat page, set a variable value to the page number you are coming from. Then, on the cat page, check the value of that variable and if it’s 1, navigate to 1; if it’s 2, navigate to 2; if it’s 3, navigate to 3.

---

<div class="post-metadata">

**Author:** ![kinhangyu](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kinhangyu](https://community.thunkable.com/u/kinhangyu)\
**Post date:** [September 30, 2022, 3:14pm UTC](https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962/3 "2022-09-30T15:14:42Z")

</div>

i don’t understand used what code to do that. Can help me write the code in my sample project? Thank you

---

<div class="post-metadata">

**Author:** ![kinhangyu](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kinhangyu](https://community.thunkable.com/u/kinhangyu)\
**Post date:** [September 30, 2022, 3:28pm UTC](https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962/4 "2022-09-30T15:28:44Z")

</div>

[https://x.thunkable.com/copy/b561eb5ed32059afd918f0f37dfcf52a](https://x.thunkable.com/copy/b561eb5ed32059afd918f0f37dfcf52a)

This is my sample project link, thank you

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [September 30, 2022, 3:48pm UTC](https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962/5 "2022-09-30T15:48:25Z")

</div>

See this modified project:

[https://x.thunkable.com/copy/46a296f1de4096d8c93ef4444d71f111](https://x.thunkable.com/copy/46a296f1de4096d8c93ef4444d71f111)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/8/a8353f23fda0e1826e38d7fe7c1950906510d6ca.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/6/460c441a8ef1d13c717d7aaf2ba3f73e05e0b13e.png)

---

<div class="post-metadata">

**Author:** ![kinhangyu](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@kinhangyu](https://community.thunkable.com/u/kinhangyu)\
**Post date:** [October 1, 2022, 3:09am UTC](https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962/6 "2022-10-01T03:09:35Z")

</div>

thank you for your help!!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [December 30, 2022, 3:09am UTC](https://community.thunkable.com/t/solved-how-do-i-programmatically-navigate-to-the-previous-screen/2063962/7 "2022-12-30T03:09:46Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
