Help needed with drop down menus

Hi,

I have an app that allows students to enter their lessons into a schedule. The lessons are displayed in a list and the user selects one to add that lessons to the schedule. Here is what the screen looks like:

When a user selects a subject, it is added to the first available text input. I want to implement a ‘back’ button which removes the text of the last filled text input. I have developed a procedure but I can not get it to work:

Here is a link to the project:

https://x.thunkable.com/copy/c4263d1e32606aba5e51e2d01eae7712

Any help would be much appreciated.

Thanks!

1 Like

Why don’t you store the text input count when filling those components? If you create a variable called something like lastInputNumber and start it at 0, you can increase it by one each time a list viewer item is clicked.

Then, when the user clicks the back button, you just do in list all text input in Set Up Timetable set # app variable lastInputNumber to "". And decrease lastInputNumber by 1.

Then there’s no need for a loop.

2 Likes

Hi @tatiang thanks for your advise. I have tried implementing this however, it is not working. Here is what I have made:

Is there a reason you’re subtracting 1 from app variable last input number? If that value starts at 0 and gets increased by 1 when an item is clicked, then it would be 1 after the first item is clicked and if you subtract 1, you get 0 meaning that you’d be setting list item #0 which isn’t possible.

I know that might be confusing… just wondering why you have that subtraction in the when back Click section.

Oh wait, I just noticed that you’re setting the list item to “” but I think you need this Any Component “set” block instead:

1 Like

Thank you very much @tatiang , it works now. :slight_smile:

1 Like