Besides the obviously expanded functionality, If/Else If and If Error blocks have a few differences behind the scenes compared to regular If/Else blocks that can be a little confusing if you’re not prepared for them.
The Differences Between If/Else, If/Else If, and If Error
In regular If/Else blocks, Return and Continue If cards stop the entire FLO, and in the case of Return cards, send data back up to the parent FLO, as shown below. You can see that the “Add” card after the If/Else does not get run when this Continue If inside the If/Else halts the FLO:
However, in If/Else If blocks, you’ll see different behavior. Instead of halting the entire FLO, it will just halt the If/Else If block and move on to the rest of the FLO, like below. In this example, you can see that the Add card after the If/Else If block does run, as opposed to before:
An If Error block works the same way as an If/Else If block. The Continue If only halts what’s going on inside the block, not outside of it:
Azuqua treats these three functions as if they are FLOs within your current FLO rather than just a piece of your FLO. So it acts the same as having a Continue If card inside a Child FLO.
One of the common places to trip up with this behavior is with return cards. If you use a Return card inside an If/Else card in a child FLO, whatever you put in the Return card will be sent up to the parent FLO. However, in the case of If/Else If and If Error, you need to put the Return card outside of the blocks in order for this to work.
Every If/Else If and If Error block has a “View Outputs” button in the top right corner. To get data out of an If/Else If card, this is what you’ll want to use. For example:
As shown in the gif, you can see that every branch of the If/Else If block is adding an output to the “sum” field in the outputs. This sum field will have data in it whether the FLO goes down the first, second, or third branch. Then, you use that sum value in the Return card after the If/Else If. You should still do this even if there’s only one output that you’re looking to return, otherwise it won’t work as expected.
If you have any questions about the way these work functions work and the differences between them just post them here!