How to continue with "then" in server actions

Hello everyone, probably a simple question. In server actions, how can I add a "continue" so that nothing happens and the execution just moves forward?

In my case, I want to create only one database update that can be executed based on different conditions.

In the following image, the same action is executed under two conditions:

However, I believe it would be better this way, but the "then" requires an action.

Using the second method, I could probably repeat these executions with an Execute Action

What is the best way to handle this? Thanks!

  1. You could assign a variable a value in the Then portion. That value could serve as a check to make sure your logic went down this path. You could test the value of the variable later in your API if you wanted.

  2. You could return a response of 200 which would allow the API to keep executing.

  3. You could reverse the condition tests to NOT, using ! in front of your condition statements. This would let you use the "ELSE" to proceed normally without having to put anything in the ELSE step. Your THEN statements would have the next Condition instead of your ELSE statements.

1 Like

Sorry, my #2 solution won't work as described. If you send a response of 200, the API will stop executing based on the way Wappler's response component works. If you wanted the API to stop executing with a success, then this method would work correctly.

1 Like

You could just insert a comment " i " under "then" it will work.

2 Likes