Mind clarifying a bit more as to the flow. For my example here , I have three states. You can have multiple states and then move use the appropriate code to move to the next state.
https://support.wix.com/en/article/editor-x-using-multi-state-boxes#step-2-add-and-design-the-states