Creating a Script Boolean Switch

Is their a way to make a Boolean switch as to run a part of a script. I want to have the option to have the script make the new view. Right now im just connecting 2 watch nodes.

You can use an If node with a boolean switch to pass through your view or a null value.

Thank you it worked