Ksenia1
November 27, 2020, 9:59am
1
I have an EnumList that suggests email addresses as it’s value taken from another column. The EnumList allows other values, too. Is there some way to check the user’s entry for email address?
In my “Valid If” I have taken the following snippet from User Email authentication error :
User Email authentication error
However, if a “correct” (containing “@” and “.”) email address is already selected, the check for the individual entry will fail.
Screenshot of EnumList Type Details:
My Valid If expression:
Steve
November 27, 2020, 1:24pm
2
Please post screenshots of the EnumList column configuration that includes the Type Details section, and of the complete Valid If expression.
1 Like
Ksenia1
November 27, 2020, 2:55pm
3
both added to my post above
1 Like
Steve
November 27, 2020, 3:06pm
4
Well, I’m confused. I see nothing wrong with the screenshots you’ve posted. Could you post a screenshot demonstrating the problem and/or error?
Ksenia1
November 27, 2020, 3:27pm
5
The EnumList has an initial value. If I add an invalid email entry to that value, it goes through:
Whereas, if the choice is cleared first and the invalid address is added afterwards, I get an error message:
1 Like
Steve
November 27, 2020, 3:33pm
6
Hmmm… This may prove to be a big problem.
Note that a comma (,) is not explicitly disallowed by the Valid If expression. Perhaps try adding it?
1 Like
Ksenia1
November 27, 2020, 3:42pm
7
But if I add NOT(CONTAINS([_THIS], “,”)) to the Valid If, it will prevent making several choices as (,) is the Item separator at the same time
1 Like
Perhaps the below valid_if expression could be tried
It assumes that the user adds emails through the ADD option in the enumlist dropdown button (Red box in the image below)
AND(
AND(COUNT([_THIS])=COUNT(EXTRACTEMAILS(TEXT([_THIS]))),
CONTAINS([_THIS], “@”),
CONTAINS([_THIS], “.”),
NOT(CONTAINS([_THIS], “!”)),
NOT(CONTAINS([_THIS], “#”)),
NOT(CONTAINS([_THIS], “$”)),
NOT(CONTAINS([_THIS], “%”)),
NOT(CONTAINS([_THIS], “^”)),
NOT(CONTAINS([_THIS], “*”)),
NOT(CONTAINS([_THIS], “(”)),
NOT(CONTAINS([_THIS], “)”)),
NOT(CONTAINS([_THIS], “?”)),
NOT(CONTAINS([_THIS], “`”))
)
2 Likes
Ksenia1
November 27, 2020, 4:11pm
9
Suvrutt_Gurjar:
AND(> AND(COUNT([_THIS])=COUNT(EXTRACTEMAILS(TEXT([_THIS]))), > CONTAINS([_THIS], “@”),> CONTAINS([_THIS], “.”),> NOT(CONTAINS([_THIS], “!”)),> NOT(CONTAINS([_THIS], “#”)),> NOT(CONTAINS([_THIS], “$”)),> NOT(CONTAINS([_THIS], “%”)),> NOT(CONTAINS([_THIS], “^”)),> NOT(CONTAINS([_THIS], “*”)),> NOT(CONTAINS([_THIS], “(”)),> NOT(CONTAINS([_THIS], “)”)),> NOT(CONTAINS([_THIS], “?”)),> NOT(CONTAINS([_THIS], “`”))> )
That did the magic! (Little remark: the first “AND( ” is redundant.)
Thank you so-so much!
2 Likes
Good to know it works the way you want. Yes, the first AND was a typo -my bad.
1 Like
Please take a look at the help articles on the EXTRACT functions in general and EXTRACTEMAILS() in particular because the solution is based on EXTRACTEMAILS() function and solution’s accuracy will depend on that function’s accuracy in extracting emails from a list.
The valid_if expression basically validates that count of list elements in the field is equal to count of email elements in the list.
2 Likes
Steve
November 27, 2020, 6:14pm
12
If EXTRACTEMAIL() recognizes only valid addresses, you could just use it as the entirety of the Valid If expression:
ISBLANK([_THIS] - EXTRACTEMAILS([_THIS] & ""))
Good call, @Suvrutt_Gurjar !
5 Likes
this worked for mi
ISNOTBLANK(EXTRACTEMAILS([EMAIL]))
1 Like