Can anyone help me replace all of this with anycomponent blocks?

I am creating a behavior tracking app for parents. they can choose up to 5 behaviors. there are 5 choices for data recording format for each behavior. is there a way to do this more efficiently using the anyblocks?

[edit] The screenshot of the UI is cut off, there are 5 buttons in each row and 5 total rows on that section of the ‘set up’ screen

Screen Shot 2020-01-17 at 1.18.49 AM

What is causing your difficulty? Take “Any button click” and implement the logic inside this block.

изображение

Thank you @actech r the feedback. I Was thinking that’s what I needed to use, But am not sure how to implement the logic within the blocks.

I am wondering if someone can help me to figure this part out. Or if there is a tutorial that may help me learn to do this with non-cloned rows/Buttons.

I think what I really want is to understand how to use them. I do t understand the logic of those blocks currently

(Edit) the idea with this screen is that the user makes a choice and is navigated to another screen. So whatever they pick needs to be stored in a variable to control dynamic content. Then, when this screen opens again, the buttons would need to retain the on/off color scheme.

I just found this example by @tatiang but can’t fogure how to use it for saving a value to a variable. Just for color changing a button after it is clicked. I need the buttons to retain color every time the app closes/opens based on a stored variable

What you’re trying to do is complicated but I would suggest using a list or possibly two lists to store the closed/open values. The reason for a list is that the Component block returns the button ID, which is unique to each button. So if you store the ID and the closed/open value (either as a pair in a single list or in sequential order in two lists – e.g. the first element of one list is the ID of a button and the first element of the other list is the value for that button) then you can retrieve them by searching for an ID when a button is clicked and getting the value from the list for that ID.

You’d then need to save the lists to the device or to the cloud.

That sounds like the solution, but above my skills at this time. I am okayish when working with lists, but I need to understand the logic of your first example before I can follow the text explanations. I try to follow it by reading it outloud in logic terms but i get lost… i have a lot of practice and learning to do still :slight_smile:

One quick question - just looking into a template for this - is this a case where the user can only choose one option out of the 5 choices?

1 Like

yes. when they make the choice, that choice is stored the corresponding variable “stored BX1dataformat”, “stored BX2dataformat” etc. you can only have 1 data format for that behavior at a time.

Here is a link if anyone wants to check it out! I would love FB on optimization or if you use it and like it or don’t! The DataSheet screen alone has over 1000 blocks after using functions for optimization

https://x.thunkable.com/copy/4e80d400b2290d0ce696fb14c9a03fd9

Any Component blocks are a mind****. But I’ll see if I can make a little tutorial for you soon.

1 Like

The project is private I cant help you further =(

have you tried like this ?

Thank you! They really are hard to understand for me. I think i am starting to get how to work with them it but i still dont understand the logic with them or how to limit the items or change things.

I can use the “on any button click” block. beyond that my brain rolls… unfortunately. i would love some good tutorials to use the anycomponent blocks. or any explanations for that matter.

Here’s a video I just made that explains one way to use the Any Component blocks. I hope you find it useful. There’s a link to the project on the title screen of the video.

(Cross-posted to Thunkable X Tutorials)

1 Like

yes! I have been doing these as well! thank you!!

i wish i had before and after shots of the blocks. Using regular functions and function with outputs have saved me at least 400 blocks in my main app i am developing

The best!!! Thank you!