set("this_is_one","one");return $my_array;(the code works fine, you can see copy/paste from Debugger at the end of the post)​2) then I'm setting Loop Event with IF Conditon and Event Switcher inside. I've inserted both, hoping that at least one would work:​​​​The idea here that messages shown ONLY when "one" is detected. the code IF CONDITION: / EVENT SWITCHER: {var:loop_event3.row} is inside message body to check how it works.​3) and this is resulting messages:​DESPITE ACTUAL DATA LOOKS LIKE THIS:Array( [php1] => Array ( [returned] => Array ( [test_data] => Array ( [0] => one [1] => zero [2] => one [3] => zero [4] => zero [5] => zero [6] => one [7] => zero [8] => zero [9] => zero ) ) [var] => Array ( [test_data] => Array ( [0] => one [1] => zero [2] => one [3] => zero [4] => zero [5] => zero [6] => one [7] => zero [8] => zero [9] => zero ) ) ))So, NONE of "logical" actions working here as expected. Actually, doesn't work at all. I ALREADY TRIED 0 and 1 instead "zero" and "one", with same result..​I'm attaching form backup, so you can open it and check it by yourself.​I REALLY NEED THIS THING TO WORK, ANY HELP APPRECIATED! ​[file=12787]Test_Conditions_16_Mar_2020_00_16_45.cf6bak[/file]"> Event Switcher and If Conditions doesn't work inside Loop Event - Forums

Forums

Event Switcher and If Conditions doesn't work inside Loop Event

artsapiens 15 Mar, 2020
First of all I'm not sure if it's really related that these actions are inside Loop Event, but I couldn't find anything on forum on this matter.

I'm attaching simple form backup to play with, but overall problem is following:

1) Let's say, I create some array with random "zero" and "one" values (php code below):
for($i=0; $i<10; $i++) {
if (rand (0, 1 ) == 0) {
$my_array['test_data'][$i] = "zero";
} else {
$my_array['test_data'][$i] = "one";
}
}

$this->set("this_is_one","one");

return $my_array;
(the code works fine, you can see copy/paste from Debugger at the end of the post)

2) then I'm setting Loop Event with IF Conditon and Event Switcher inside. I've inserted both, hoping that at least one would work:






The idea here that messages shown ONLY when "one" is detected. the code IF CONDITION: / EVENT SWITCHER: {var:loop_event3.row} is inside message body to check how it works.

3) and this is resulting messages:


DESPITE ACTUAL DATA LOOKS LIKE THIS:
Array
(
[php1] => Array
(
[returned] => Array
(
[test_data] => Array
(
[0] => one
[1] => zero
[2] => one
[3] => zero
[4] => zero
[5] => zero
[6] => one
[7] => zero
[8] => zero
[9] => zero
)

)

[var] => Array
(
[test_data] => Array
(
[0] => one
[1] => zero
[2] => one
[3] => zero
[4] => zero
[5] => zero
[6] => one
[7] => zero
[8] => zero
[9] => zero
)

)

)

)
So, NONE of "logical" actions working here as expected. Actually, doesn't work at all. I ALREADY TRIED 0 and 1 instead "zero" and "one", with same result..

I'm attaching form backup, so you can open it and check it by yourself.

I REALLY NEED THIS THING TO WORK, ANY HELP APPRECIATED!
​[file=12787]Test_Conditions_16_Mar_2020_00_16_45.cf6bak[/file]
healyhatman 16 Mar, 2020
CAN CONFIRM: After the first loop where the event switcher activates a different branch, both branches are run.

E.g. if the pattern is 0 0 0 1 0, then the 0 branch gets run by itself 3 times, then the 0 and 1 branches get run together twice more.
This topic is locked and no more replies can be posted.