Understanding Check Boxes (Toggles)

Is there a way to create a property within a collection…let’s say the property name is “YesNo”.
I want the toggle button to change the value of that property…

How is this accomplished?