Using "Switch" field in custom code as boolean operator

Hi everybody!
I want to execute something in custom code only when a certain switch for the CMS element is turned on, is there any way to use a “Switch Field” as a boolean operaton in custom code?

I was thinking something like this:
“Bilder im Querformat” is the Switch Field.

Hey @dilerdesign !

A Switch Field is already a boolean, so you don’t even need any logical operator in your condition to make that work.
You can simply put your Checkbox field as the condition, and it will return truthy if it is checked and falsy otherwise.

Hope that helps !