Else-If Question

Will these 2 different else if's have the same affect?

From a program flow standpoint, yes. The essential difference being that ELSE-IF introduces a new condition to test against, whereas ELSE only executes its block of code if the preceding IF was false.

1 Like

Thanks

1 Like

I have read over your answer many times and not sure I still understand completely. I have 2 different else if's. Only difference is 1 is "else-if" and the other is "else" and "if" on seperate lines. Also on this logs picture I did not think all my actions would have skipped after end if.


Actually the end if is above the highlight

If you look at the rule's top level as composed of an IF block and an ELSE block, then the Logs show the IF evaluated to True, so only its Actions were performed. Everything from the outermost ELSE on down was then skipped.

Accordingly, the inner (indented) IF-ELSEIF-ELSE blocks were never evaluated.

Perhaps in my initial reply, I should have commented how the two circled blue expressions are on different levels (one is nested inside the other). I thought you were just asking about how conditionals function in general.

Thanks. I am going to have to think about it to get my head wrapped around it, I'm starting to understanding.

If you post a more complete screenshot of the Rule itself (including Triggers and Actions), I'd be happy to help you analyze its logical flow in more detail.

Thanks so much. I think I have it now. I want it to run all the way thru to the 9:15 action. I did run it and the logs look to me like it is working.

Very nice work!! Circle back if anything doesn't work according to plan. :slight_smile:

1 Like