Valid_if expression returning List

Hi everyone,
Can anyone tell me

Why is this Valid_if formula returning an Enum List?

The column type is set as Email.
I want to accept only those emails contained in Usuarios[Email]

Actually if wrapping the expression with NOT() it works fine, but it shows the Invalid Value error when the [Email] is in the list, not the other way around which is what I need.

Thanks!

Solved Solved
0 7 223
1 ACCEPTED SOLUTION

Thatโ€™s surprising. This one should work:

CONTAINS( CONCATENATE( Usuarios[Email] ) , [_THIS] )

View solution in original post

7 REPLIES 7

Notice how above where you enter your expression, in parentheses at the end, it displays the data types that it expects your expression to return. You can create Dropdown lists by entering an expression that returns a List into Valid_If, regardless of the specified column type .

Additionally, Appsheet tries to be smart and give you what it thinks you want. You would have gotten the same results by just typing in Usuarios[Email]. They are essentially the same in this case, and Appsheet โ€œknowsโ€ it, so has provided you with the dropdown.

If you do not want the dropdown, I believe you can make your expression more complex in order to โ€œde-activateโ€ Appsheetโ€™s intuition. Try the following:

IN( [Ingresa tu correo electronico] , SELECT(Usuarios[Email] , TRUE) )

Thanks @Marc_Dillon , Great explanation!
I did try that too and it didnยดt work either.

Itยดs still showing the dropdownโ€ฆ

Thatโ€™s surprising. This one should work:

CONTAINS( CONCATENATE( Usuarios[Email] ) , [_THIS] )

Awesome, this worked!

Thanks so much! Iยดve been going around this for hours!

For future reference:

This explains what @Marc was saying:

Appsheet tries to be smart and give you what it thinks you want. You would have gotten the same results by just typing in Usuarios[Email]. They are essentially the same in this case, and Appsheet โ€œknowsโ€ it, so has provided you with the dropdown.

But it doesnt explain what to do if you do not want a dropdown, and just want to check if a value is part of a list.

Steve
Platinum 4
Platinum 4

Using CONTAINS() is really not a good alternative here, generally speaking. Better:

AND(IN(...), TRUE)

or:

OR(IN(...), FALSE)

Yes, go with what @Steve suggested, if it works.

Interestingly, in this case, with an Email type column, you get the internal column type validity check as well which forces the correct structure of an email address, and allows the contains expression to work at least most of the time. If weโ€™d used the same expression on a Text-type column, you could get โ€œvalidโ€ inputs that were just a single letter.

Top Labels in this Space