Help! How To Reduce Blocks Using Procedure And AnyComponents?

Hey! I’m a student currently working on a school project about an restaurant app.

I have 12 menu in total, but some of them have 2 choices.
E.g : Customer can pick between HOT or COLD when ordering a coffee.
And, as a result, i have 23 different outcomes due to having the customer pick between 2 choices for some of the menu.

In my app, i have 2 screen.
The 1st Screen display all the 12 menu for customer to pick their dishes.
And the 2nd Screen is a cart that display what they have picked.

What im doing is im using TinyDB to record the quantity of those 23 outcomes, then transfer the data to the 2nd Screen.
If the quantity > 0 , then it will set the Label to true and set the amount to the quantity saved by TinyDB.

I’ve searched over the web that theres a method to minimise the blocks by using Procedure and AnyComponents instead of repeating the blocks 23 times.

Maybe someone can help me here?

This looks like Thunkable Classics.

If so you should edit the topic to #classicdiscuss to get the attention of people who use classics. You will get an answer faster :slight_smile:

2 Likes

Just create a list containing the tags, and use a “for item in list” loop to compare with TinyDB. Then the blocks can be greatly reduced.

(P.S. I am using Thunkable X but you should get the idea.)

2 Likes

Great! :+1:

I am having a similar question.

my users track behaviors with the app. they can choose 1 of 3 different recording formats for any beahvior they are tracking. based on the recording format, the corresponding button will turn green while the others remain orange. I would like to reduce the number of blocks required if possible.

Screen Shot 2020-01-15 at 12.38.34 PM

here is another example

. in this, i control what shows up on the data sheet screen. I am displaying dynamic row content based on the number of behaviors the user wishes to track.

and a last one if anyone is up for the challenge to assist!