Button events in a Dynamic Element

Hi,

I have an element that repeats as many times as there are results in the database. This element has two areas (1 and 2). I have two buttons. The first one hides area 1 of the element and shows area 2, and the second button reverses this action. I used variables, but they are global, so they show and hide the areas of all elements simultaneously. I have chosen not to save the variable for other pages, but it does not keep it local. Regarding workflows, those are global too.

SOLUTION:
I was looking to avoid working with components due to a bug that limits the access to childs of component. But is the only way to create button that make’s changes to the childs of component only in dynamic environment.

Follow this doc Intro to components | WeWeb Documentation

And for backup of the components add first in library as normal elements.

Have a great day.

Is there an option to do this?

Thank you,