Else do nothing?

Is there an expression (or community trick) to create a conditional expression that does nothing if it evaluates to false? My use case is that I want one Y/N column to be N if another one is true, but otherwise leave the value up to the user. IF always wants an ELSE and IFS without an ELSE evaluates to NULL which is not what I want.

You can use SWITCH in the initial value, like:

SWITCH([Option1],
"Y","N",
""
)

Can you elaborate more? There are several possibilities, but I’m not sure which might be appropriate for you.

I have two Y/N fields: On Hold and Reference Only. If On Hold = Y then I want Reference Only to be N. But if On Hold = N then I don’t want to predefine a value for Reference Only. I don’t want it to be NULL, I want the user to be able to select the value themselves. I tried this expression for Reference Only:

IFS([On Hold],FALSE)

But that sets it to NULL (and hides the field) if On Hold is set to N. And of course:

IF([On Hold],FALSE,TRUE) will explicitly set it to the opposite of On Hold

Does this help?

@Heru I tried your suggestion and it is the same outcome as my IFS expression. Instead of “Do Nothing” these expressions force the value to NULL.

Please try with following settings for [Reference Only] field

Initial Value as below

IFS([ON HOLD]=TRUE, FALSE)

Editable_if constraint as below

[ON HOLD]=FALSE

1 Like

Hmm, maybe different understanding. Sorry…

I just test it and look like this:

YES-NO 2020-06-09_10-47-57

1 Like

Hi @Heru,

As per my understanding, when the Option1 is “Y” , @Jamie wishes Option2 to be only “N”, thereby giving no choice to the user to select “Y” for Option 2 when Option 1 is Y, something like below

image

When the Option 1 is N, then user can select both choices from Option 2

image

So I believe, our initial condition expression achieves similar results. Just that an additional Editable_if condition as described above does not allow the user to select any choice when the Option 1 is “Y”

Edit: Of course my understanding could be incorrect.

2 Likes

Thanks gents - I’ll try again today. To clarify, I had been putting the conditional expression into the column’s formula not the initial value.

2 Likes