I'm having this problem in other big and complicated form, but recreated in smaller scale.
What I have is several parts (layouts) in form, which should be displayed in different cases, all layouts sets PageType to "Standalone". See screenshot:

in load's Actions I have simple Read Data, which reads users from DB, and then Loop Event which starts with trivial php, which looks into users's ID number and if it's less than 700, sets some data:switcher value to "1" , otherwise "2":

and this is the result:

As you can see, the code works well and returns correct numbers 1 or 2.
But Event Switcher somehow doesn't actually switches events, it somehow MIXES results when the second choice should be selected
Am I doing something wrong?
How to solve this mystery?
form file attached. depending on your Joomla actual state you may want to change "700" in php code to some other number to split your users id numbers.
EDITED: Also if testing, you're going to need to choose correct table from your db, because they all have unique prefixes!
[file=12716]test_event_switcher_28_Feb_2020_00_08_08.cf6bak[/file]
What I have is several parts (layouts) in form, which should be displayed in different cases, all layouts sets PageType to "Standalone". See screenshot:

in load's Actions I have simple Read Data, which reads users from DB, and then Loop Event which starts with trivial php, which looks into users's ID number and if it's less than 700, sets some data:switcher value to "1" , otherwise "2":
if ($this->_vars['loop_event5']['row']['Data1']['id'] < 700) {and after php but still inside Loop event there is Event Switcher with following settings:
$this->data['switcher'] = '1';
} else {
$this->data['switcher'] = '2';
}
// some output to check if code works correctly:
echo ('');
var_dump ($this->_vars['loop_event5']['row']['Data1']['id'] , $this->data['switcher']);
echo ('');

and this is the result:

As you can see, the code works well and returns correct numbers 1 or 2.
But Event Switcher somehow doesn't actually switches events, it somehow MIXES results when the second choice should be selected
Am I doing something wrong?
How to solve this mystery?
form file attached. depending on your Joomla actual state you may want to change "700" in php code to some other number to split your users id numbers.
EDITED: Also if testing, you're going to need to choose correct table from your db, because they all have unique prefixes!
[file=12716]test_event_switcher_28_Feb_2020_00_08_08.cf6bak[/file]