Problem with conditition to fill out all text boxes

Hi,

I am currently designing a planner application for my school and I am running into some trouble with designing a way for users to enter their lessons. I have a screen which allows users to enter their lessons (see screenshot below) however, I need to create a condition to ensure that the user fills out all the textboxes before entering the lessons for the following day.

When a run the app and do not fill out all textboxes, a message appears notifying the user to fill out all boxes. This is working as intented. The issue is when you continue to fill out all textboxes once the user has seen the message, the app does not store the data and move on to the next day as intened.

I think the problem is how I am using the ‘any’ component but it could be something else, I’ve attached a screenshot of the blocks I am using.

If anyone could help me with this it would really be appreciated.

Thanks.


1 Like

I don’t see anywhere in your code that you are saving the information somewhere. I either understood your message wrong or looking at the wrong image of the blocks.

2 Likes

@muneer in the function, each lesson the user enters is stored in a list ‘stored variable timetable’ onf after another.

1 Like

Yes, I could see that from your code. But to show these stored (only for the life of the app session) data you need to assign them to some kind of components in the screen.

Without coding some kind of block to show what is in the list it will not show on the screen by itself.

You may need to share a link to the project because what you’re describing with Any Components and what you’ve posted are two different things. It’s also not clear from your screenshots what event (e.g. button click) is triggering the navigation to the next page. There’s just too much missing information to help with this issue.

3 Likes

@tatiang here is the link to the project, the code is on the ‘set up’ screen.

2 Likes

@muneer Yes, the list is shown on the following screen once the user has entered all the data. Once the set up is complete, the app automatically navigates another screen where their timetable is shown.

2 Likes

I don’t see the link to the project so the question is “Are you showing the content of the list in the following screen the correct way”?

The link is missing. :frowning:

1 Like

@tatiang I’m really sorry, here it is:

https://x.thunkable.com/copy/2bccb98067f41122c8ef25cdf6c5390a

@muneer here is a link to the project if you want to take a look:

https://x.thunkable.com/copy/2bccb98067f41122c8ef25cdf6c5390a

The problem isn’t really with the list showing, that is working fine, it is more about the condition for the user to fill out the text boxes. Any suggestions on how to fix this would be much appreciated.

1 Like

The is Empty coding block expects a component but you are supplying a list which will not work.
image

I suggest you create a function that will return false if any of the text fields empty. This way you achieve what you are trying to do now.

[Suggestion]

I would do something like this

Create a function to run through all the fields and check them one by one. If any of the fields is empty the function returns False otherwise it returns True
image

The next step is to change your main function to use the created function.

The last step is to reverse the order of codes you have and use the long list of code in the do part and the warning message in the else part.

like this
The do part (partial)

The else part
image

Happy Thunking!

1 Like

@muneer I added all of your suggestions however, it is still not working correctly. Now, it is not showing the error message at all and proceeds to populate the table. What could I be doing wrong?


Screen Shot 2564-09-17 at 11.57.48

1 Like

How do you know it’s not working?

What made you think the code has a problem?

1 Like

@muneer I live tested the code and it was not displaying the error message when a text box was not filled out. However, I seemed to have got it working with a simple modification to your original code:
Screen Shot 2564-09-17 at 13.05.59

Thanks very much for your help though, I really appreciate it!

1 Like