Message Boards Message Boards

Back

Sequence of actions

Sequence of actions
Answer
8/9/19 4:39 AM
How do actions choose their order of execution?

In other words, if I have two actions, both triggered by onPageLoad, and one of those actions sets a variable to true and the other action is conditional onPageLoad, if the variable is true.

Traditionally, with an ordered script, if the conditional action came first, then it would not trigger on the first page load since the variable wasn't yet set to true.  However, if it was sequenced second in the script, then it would fire the first time the page was loaded because the variable would have already been changed, and the conditional action would be true.

With the non-linear layout of the action panel, I'm not sure how to account for this...

Thanks!
0 (0 Votes)

RE: Sequence of actions
Answer
8/9/19 4:27 PM as a reply to Leif Cederblom.
Hi Leif,
As you mentioned, the order of actions usually doesn't matter because they have different triggers.  When two actions have the same trigger, it's their placement that detemines the order (top to bottom first, then left to right), and the number next to the "when" will tell you which one comes first.  So in image1 below, it is in the correct order, but in image2, with the "first" action slightly lower than the "second", it's going to check before it sets the value, so that's probably not what is desired.

Note, that you can usually combine these two functions into a single action (shown in image3).

If you're trying to coordinate actions between a Master and a regular page, and each have an onPageLoad, things get a little trickier, because it's a bit of a toss up as to which will load in first.  There are some other techniques that you can use if that's the case (Global Events).

Hope that helps!
0 (0 Votes)