Does Monday have something like COND()?

In LISP, there’s a function called COND(). I’m wondering if Monday has something similar, because I’m getting buried in nested IF() statements. Here’s how it works…

COND(
(test1 action1)
(test2 action2)
(test3 action3)
)

In LISP, the test1 is evaluated. If TRUE, it performs action1 then exits. Then it moves to the next if/then pair until it reaches the end.

@jscottsmith

The closest are the SWITCH() and the undocumented CHOOSE() functions (see more here: https://themondayman.com/hidden/). But, there are other ways to deal with situations like that.

For one way to deal with these, you can check out this video starting at about 21:50

Or, post some details…

Jim - Subscribe to The Monday Man
Watch Our Latest Video: The Power of the Right-Click

1 Like

You asked for details… :slight_smile:

@jscottsmith

A few things…

  1. Hovering over the red error icon will give you some “why”.
  2. Some monday functions always work in lower case, some never, some sometimes… always safest to use upper case on all e.g.: IF() not if().
  3. Best to always include all three segments of IF()… IF(condition, if-true, if-false). IF(1=2,0) returns a boolean “true” . IF(1=2,0) + 0 returns an error. (this is the problem with dura-both… number + 0 + true = error)

Jim - Subscribe to The Monday Man
Watch Our Latest Video: The Power of the Right-Click

I’ve hovered before, but the only error I’ve ever seen in Monday was “one of the parameters is invalid”. That’s helpful, but doesn’t narrow down much.

I thought I had seen the caps thing before, but then it worked so I thought I imagined it. I’ll go back to caps. Easier to read functionality anyway.

The # vs true makes a lot of sense. I’ll do some testing.

Thanks!!

I’m not following this part.

To make it simpler, let’s just look at the first line, because I appear to be missing something there as well…

IF({TimerStatus}=“Active”,{dura-live},0)

I have that in the “formula” column below, and this is the result:

Why am I getting an error?

@jscottsmith

Are you up for a call? Might be faster. You can contact me directly here: Contact – The Monday Man

It looks like there might be a COND() function now. Or at least it turns blue when I type it. I can’t find any documentation. Anyone know about this?