[2.4.0.145 C8 Pro] Can't insert "ELSE IF" into Rule 5.1

I'm trying to add another "ELSE-IF" branch to a rule (5.1) but it doesn't seem to recognize that it's in a series of ELSE-IFs where that is allowed (note: This is copied from the middle--there's a proper "IF" at the top):

@bobbyD Any thoughts?

1 Like

Is there more to the rule prior to the lines you shared in the OP? I ask because, syntactically, one normally starts with an IF statement and then adds ELSE-IF’s, whereas you are starting with ELSE-IF. I can’t say that’s the root cause problem, but it’s the first thing that jumped out at me.

Hope this helps.

Yes, there's a bunch more to it (but it wouldn't fit in a screenshot).

It starts with a proper "IF"--and the rule works perfectly.

Just that editing it, now, I have to copy & paste the "Else-If" and "End-If" in there. That didn't used to be a problem.

1 Like

C-8 running v2.4.0.145.

I had the same problem trying to add an "ELSE" into an if-then-else-end-if. I had to add the ELSE as the last action in the rule and then move it up. This used to be possible. But the only actions available are If-Then and Simple. This is reproducible.

2 Likes

I'm pretty sure the issue is that you have a complete If/End If statement, and the ELSE options only appear when your statement is not completed by the END IF.

I don't know if it always worked that way or is a recent UI change. It makes sense that the ELSE and END IF options disappear from the bottom of the table when there isn't an open statement.

Did clicking the + signs between the IF and END IF previously offer the option to insert an ELSE inside a complete statement?

The Else and End statements at the bottom aren't the issue.

The issue is, there isn't ANY way to insert an Elseif into a rule. That used to work.

Yes. Clicking the + sign between and IF and an END IF and selecting "Conditional Actions" used to give the entire list of possible conditional statements: IF THEN, ELSE, ELSE-IF, END, and Simple. ELSE can be added at the bottom of the code and then laboriously moved up. But there's no way at all to add an ELSE-IF.

I can think of two reason off hand that removing this does not make sense:

  • No code is static. There's always the need to be able to modify code that is either not working as intended or needs to handle a new or changed set of circumstances. Modification may include changing conditional statements, and those statements may need to be made more complex.

  • Personally speaking, if I'm adding an IF into the middle existing code I almost always immediately add the END-IF as well. That keeps statements in/out-dented appropriately and, given the rather "interesting" nature of the Rule Machine GUI, makes it easier to see where I'm at and what I'm doing.

4 Likes

@bobbyD I reproduce it with a simple test case.

It seems that any time you have a "nested" IF-THEN-ELSE, you can't insert conditional statements into it....

1 Like

See my screen shot above. You can't insert ELSE or ELSE-IF into any conditional statement. it doesn't have to be nested.

2 Likes

I'm seeing the same problem. I'm trying to insert an ELSE-IF to convert an ELSE. Can't do the insertion above or below the existing ELSE.

I'd like to know your secret, because it's not working for me.

I usually use Safari, but tried Chrome with the same results.

C8 running 2.4.0.147.

I thought maybe with a brand new rule that had never been changed it might work, and then stop working once the actions were saved. But that proved not to be the case, either.

I'm out of ideas.

In the little test rule I made above there's no ELSE in the original. But I still can't add an ELSE.

If I remove the END-IF, then I can insert an ELSE or and ELSE-IF anyplace in the rule. So I think it has something to do with the IF / END-IF being seen as "complete". Or something like that.

But obviously removing the END-IF is only a solution if it's the last thing in the rule. If we're talking about an IF / END-IF further up in a complex rule with other conditionals, then it's not really workable.

2 Likes

Yes I can reproduce that.

1 Like