Event Actions executing before previous one is complete

I’m not sure if a bug, or if I just need to change how I’m doing this, but if I have a script, followed by an action to close the popup, the script doesn’t finish executing before the window closes.

Is there a way to make this execute in order and not close until the previous step is completed?

image

You’re not missing anything, although it’s not a bug - this is just part of the way actions work. Actions are executed in order, but script actions are invoked asynchronously on the gateway. We do have plans to add UI to make this more clear, but since scripts run on the gateway (by necessity) the script action that happens is just the invocation message being sent to the gateway. There’s no guarantee that it will happen before the next action does (in fact, you can pretty much guarantee it won’t) – the script might take an extremely long time, or never return, or throw all kinds of errors.

1 Like

Alright, I’ll move the close popup action into my script then, that should at least resolve the issue in this case.

1 Like

If you have an event which requires that a Script Action be utilized, and you want things to happen IN ORDER, then yes, you should include all Actions you would like to execute in order in the Script Action. We worked hard to make sure that there were equivalent scripting methods in place for all Actions for precisely this reason.

3 Likes