we can use conditional formatting to hide/show a section, if you want to show/hide it on a button action.
have a field say hide_section_A set its default value to Hide.
on the section right click and go to conditional formatting and give a condtion
if hide_section_A is not equal to Show
and check the hide this control checkbox.
now double click on the button go to rule and in rules add ->
on condition write a condtion
if hide_section_A is not equal to Show
add action set value of a field
hide_section_A = Show.
also check the checkbox stop processing rules when this rule finishes
and another rule
if hide_section_A is not equal to Hide
add action set value of a field
hide_section_A = Hide.
also check the checkbox stop processing rules when this rule finishes
on the button properties set the default value of the button(Fx) to hide_section_A