If Relevance Statement Fails

If i have two separate relevance statements and lets say the first one fails, does the second one get executed?

in the action script, you can have multiple if statements. The next if statement would be evaluated if you close the first one with endif

if youā€™re referring to relevance statements in general, you could separate them by OR and it would evaluate either.

1 Like

I have two relevance statements followed by an action script. If both relevance statements result true then it will execute the action script. But Iā€™m wondering if the first relevance statement results ā€œFalseā€ whether the second one will execute.

In a Fixlet with separate relevance clauses, as soon as a relevance statement evaluates to ā€˜falseā€™ the Client will no longer evaluate/process the remaining relevance statements of that Fixlet. As such, it is certainly best practice to order your relevance statements in such a way as to greatly minimize the scope of applicable endpoints quickly and efficiently.

Note that this optimization also holds true within relevance statements as well with certain logical operations. For instance, if you have a statement such as:

false AND (<some complex relevance>)

or even

false AND true

The Client will not evaluate the portion to the right of AND as the result can only be ā€˜falseā€™.

As a slight addition the right side of the AND in the example @Aram gave does have to be valid for the platform, so you do have to have valid relevance there. The breakdown of the expression does happen before parsing

For example:

Q: false and boop
E: The operator "boop" is not defined. 

The exception is of course with conditionals

Q: if (false) then boop else false
A: False
2 Likes