Collapsed element acording boolean value.

Hello I have a Dynamic page which is connected to data collection. How can i Expand/Collapse some of the elelemts in that page acording to a boolean field in that collection.

I know how to use the expand/collapse function

if( #BooleanFromCollectionField )
{ $w(“#myElement”).expand(); }

My question is how to connect this #BooleanFromCollectionField to the collection.

Thanks in advance

Hi,
On a dynamic page you have a dataset, which is responsible to fetch the data from the collection and pass it on to elements on the page.
The dataset exposes API (getCurrentItem) for you to get the current item that was fetched. This way you can get the value of any field on the item.
You can read here on how to use it:

Very nice. How can I make a box, that has 2 upload buttons on it, appear when they select a specific value from a drop down before it?

You can use the onChange event of the dropdown to add a function that will be called on every change. In that function, get the value from the dropdown, and according to the value you can show or hide the box.