Else do nothing?

Jamie
Participant V

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.

2 8 1,472
8 REPLIES 8

hru
Participant V

You can use SWITCH in the initial value, like:

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

@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.

Hmm, maybe different understanding. Sorryโ€ฆ

I just test it and look like this:

2X_1_1b8ebc31b1930428ab7c6ea74994412988ae160d.gif

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

2X_a_aacd867c76bc6310c42ebd4822cafb94f3b834f1.png

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

2X_7_77afdd57e305beb9e5a641a1b2727ecb03c18b29.png

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.

Steve
Participant V

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?

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

Jamie
Participant V

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.

Top Labels in this Space