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! Go to Solution.
Thatโs surprising. This one should work:
CONTAINS( CONCATENATE( Usuarios[Email] ) , [_THIS] )
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.
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.
User | Count |
---|---|
44 | |
29 | |
22 | |
20 | |
14 |