Checking if entered value in EnumList is email

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:

Please post screenshots of the EnumList column configuration that includes the Type Details section, and of the complete Valid If expression.

1 Like

both added to my post above

1 Like

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?

The EnumList has an initial value. If I add an invalid email entry to that value, it goes through:

3X_b_8_b8026f2e8cecb1a31dda806a3e0aa6b07a6d3b87.png

Whereas, if the choice is cleared first and the invalid address is added afterwards, I get an error message:

1 Like

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

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

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

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

Beautiful!

2 Likes

this worked for mi

ISNOTBLANK(EXTRACTEMAILS([EMAIL]))

1 Like