The way to control the visibility of controls on a single screen is usually done by setting a context variable (in this example the context variable is called "var" but it could be any text) as true or false and then using that context variable as the Visibility property of the control. Context variables only work for one screen.
UpdateContext({var:true}) or as a toggle
UpdateContext({var:!var})
Either of these formulas can be put in a button, icon or checkbox and whole groups of controls can be hidden by using "var" as the Visibility property of the control. This includes galleries, data tables and forms as well as single controls like textinput boxes and labels . By setting a context variable in the OnVisible property of the screen, then a default appearance of the screen is created.. If the goal is to control the visibility of controls on all screens throughout the app, then a global variable is created the Set() function is used. ie. Set(var1, true) . If context variables and global variables are used in the same app, then the variable name for each must be different. Note that the context variable requires curly braces and ":" while Set() only requires a comma between the variable and its value)