Assume you have a custom state on a group (“X”), called ‘visible’ with the type yes/no .

The easiest way is to setup an action to “set state of an X to” and then for the state itself say (X’s visible “is no”)

what this does is check if the current state is “no” if the current state is “yes” - meaning that your element is visible through a condition you managed - the answer to this question is “no” meaning that this will become the new state, and as a consequence will hide your element.

The opposite is true as well. If your current condition is “no” (meaning the element is not visible) the answer to the question (is it no?) is yes, setting the state back to yes.

This is the most effective way (in my opinion) to manage state’s via one single button and one single workflow.

Hope this helps!