# Reverse a button click

**URL:** <https://community.thunkable.com/t/reverse-a-button-click/1572455>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [October 20, 2021, 10:54pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455 "2021-10-20T22:54:29Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 20, 2021, 10:54pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/1 "2021-10-20T22:54:29Z")

</div>

If a user clicks a button by accident, I want the user to be able to click it again to deselect it. How is that done?

---

<div class="post-metadata">

**Author:** ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)\
**Post date:** [October 20, 2021, 10:56pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/2 "2021-10-20T22:56:26Z")

</div>

Create an “undo” procedure so that when the user deselects the button anything that has happened … unhappens.

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 20, 2021, 10:58pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/3 "2021-10-20T22:58:18Z")

</div>

Exactly what I wish I knew how to do!

---

<div class="post-metadata">

**Author:** ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)\
**Post date:** [October 20, 2021, 11:00pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/4 "2021-10-20T23:00:08Z")

</div>

I’m not a mind reader and neither is anyone else.

So post your blocks showing what happens when a user selects a button.

---

<div class="post-metadata">

**Author:** ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)\
**Post date:** [October 20, 2021, 11:04pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/5 "2021-10-20T23:04:00Z")

</div>

Is it your Pilot Fatigue app or the Button as Checkbox app?

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 20, 2021, 11:04pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/6 "2021-10-20T23:04:40Z")

</div>

OK! Here is a block. If a user clicks on this button on the screen, x and y happen. I want a subsequent click on the same button to undo it all. Thank you.

 ![Screen Shot 2021-10-20 at 7.02.39 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/9/79ac3e4009e2202eb739e88bf8243a940673a59b.png)

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 20, 2021, 11:05pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/7 "2021-10-20T23:05:13Z")

</div>

pilot fatigue

---

<div class="post-metadata">

**Author:** ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)\
**Post date:** [October 20, 2021, 11:08pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/8 "2021-10-20T23:08:57Z")

</div>

Use If…else

If \>3 legs text colour is red  
Set text colour to _original colour_  
Set Fatigue score to _original score_

Else use your above blocks

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 20, 2021, 11:20pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/9 "2021-10-20T23:20:58Z")

</div>

Not sure how to make the “if statement” test for text colour.

 ![Screen Shot 2021-10-20 at 7.18.30 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/c/2c62d0be6929fab4d93bccb4b9b7c63d3223413e.png)

---

<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:** [October 20, 2021, 11:29pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/10 "2021-10-20T23:29:10Z")

</div>

Use the equals block [=] in the Logic drawer to make it say if \>3 legs’s Text Color [=] [color] where [color] is a red or blue block as you have in your screenshots.

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 20, 2021, 11:34pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/11 "2021-10-20T23:34:45Z")

</div>

Of course! Thanks - I’m a little slow.

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 20, 2021, 11:45pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/12 "2021-10-20T23:45:50Z")

</div>

I think this is what you are saying.

 ![Screen Shot 2021-10-20 at 7.43.07 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/9/e99a93d94df55dd4b731f6b4d8e5b2ce9a86ca98.png)

When I live test this, the first button click does not turn the background color to red. If I take out the “If” statement on the second block, the background does turn red after the first click.

---

<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:** [October 21, 2021, 2:52am UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/13 "2021-10-21T02:52:43Z")

</div>

You need an if/else statement but only one event, not two. I can’t post an example from my phone but I can help you later.

Tatian

---

<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:** [October 21, 2021, 4:57am UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/14 "2021-10-21T04:57:34Z")

</div>

Like this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/9/79f08794281400ee485d15d3b01258e53907d8b2.png)

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 21, 2021, 2:23pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/15 "2021-10-21T14:23:32Z")

</div>

Thanks so much

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 26, 2021, 2:56am UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/16 "2021-10-26T02:56:39Z")

</div>

This helped me reverse an accidentally clicked button, but can the same thing be done for a list? My app is a survey. Each answer is scored and totaled at the end. Some of the questions are answered by clicking one or more of a series of buttons. Some are a list from which the user can only select one answer. The way I have the lists coded, the user can click on the same list item multiple times, and the variable score increases with each click. The score also increases when the original answer is deselected (ie user clicked it by accident) and a new answer is selected.I only want one answer to count toward my variable score from each list. Here is an example of a block I used for a list:

 ![Screen Shot 2021-10-25 at 8.17.06 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/a/1a3d7974f56e6ef6e5b0a27d5b83de671951ba67.png)

---

<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:** [October 26, 2021, 4:14am UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/17 "2021-10-26T04:14:02Z")

</div>

It’s really hard to help you with such limited information. I know you’ve explained more than before but…

What does the actual survey look like? If I could see it, I could suggest a different way to structure your buttons and lists. But just knowing it’s a survey… it could be set up a hundred different ways. Are there three choices for every answer? Or do some questions have two answers while others have five? There are just so many unknowns that it’s hard to suggest anything specific.

---

<div class="post-metadata">

**Author:** ![cohoes41a8gy](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cohoes41a8gy](https://community.thunkable.com/u/cohoes41a8gy)\
**Post date:** [October 26, 2021, 1:05pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/18 "2021-10-26T13:05:59Z")

</div>

Here are two screen shots from the app.The top screen is an example of where I wanted to use a list, but converted to buttons so I could control my select/de-select problem. The bottom screen is representative of what I’d like to be able to use in some instances. Again, if I click 'red" under “characterize your stress level at work”, it assigns 200 points as seen in the block above. If I click it again, another 200 points is added for a total of 400. If I then click “yellow”, the total goes to 500 - the 400 mentioned, plus another 100 for the yellow click. The “work Stress” box below the list is what changes color as different list items are clicked. The color based on selection works as I want it to.

 ![Screen Shot 2021-10-26 at 8.56.04 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/a/fa39a856ab70dd898b2a81fda6ab091e837e2ab3.png)  
 ![Screen Shot 2021-10-26 at 8.55.21 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/2/3280945bb019d4c6e92d36c76f4ed2fc62ec9353.png)

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:14pm UTC](https://community.thunkable.com/t/reverse-a-button-click/1572455/19 "2024-11-08T13:14:46Z")

</div>


