How to handle obsolete valid value

hi there

In one of the apps I developed, there was a need to have a field (let’s say communication method) that is mandatory.
The value was selected from a list of valid values (phone, SMS, email) using validIf definition that is looking up a table of valid values.
Now after the system is used for a long time, one of those valid values became obsolete (for example, SMS is not a valid option anymore).
But the requirement is to still keep SMS value in old rows having this value selected before the removal.

I have removed this valid value from the valid values reference table.

The issue now is that when the user edits an entry having the old value, he is requested to change the value to a valid one. The edit cannot be submitted without changing to a different method.

Any advice on how to do this?

IF([option]=“SMS”, TRUE, your current expression)

Thank you.
My current expression looks like this: Methods[Method].
I tried your suggestion but got the following message:
“IF function is used incorrectly:the second input (if-result) and third input(else-result) should have the same type.”

I managed to make it work this option: Methods[Method] + LIST([Method])
This is inspired by an answer by @Steve I saw where he was subtracting lists:

So I thought about adding the current value as valid value, and it worked.

Thanks @Steve :slight_smile:

2 Likes

Ah, I see.

I was just going to correct my expression to be: IFS([_THIS]<>“SMS”, Methods[Method]) should also do the trick.

1 Like