You are viewing limited content. For full access, please sign in.

Question

Question

RegEx constraint for email

asked on December 16, 2016

I am trying to write a regex constraint for email. Using regex101.com this is no problem but when I copy the same exact expression into Forms it accepts any sort of input. How do you write the expression in Forms?

test@ is not recognized as a valid match on regex101.com

 

 

Perfectly valid in forms

0 0

Answer

SELECTED ANSWER
replied on December 16, 2016

I don't have a Forms install to test with, but I don't think @ has to be escaped with a backslash.  Maybe that is messing it up.  Also, email addresses have way more complexity and variety than most people realize.  I believe your domain filtering will block valid (but rare) classes of addresses.  I'd recommend keeping the constraint as simple as possible.

0 0
replied on December 16, 2016

Cool that was it, for some reason the other regex tester didn't warn about that. I actually had it open to enter anything but the Email activity in Forms appears to ignore invalid entries.

The user entered a letter "e" into the field and the process suspended at the email step with the message "Email recipient was not provided."

I would rather it have sent the email to "e" than halt.

0 0
replied on December 19, 2016 Show version history

You can put the email task into the try (left) branch of a try-catch task, so if the email fails, it will use the catch (right) branch and then proceed to the next step.

 

EDIT:  Sorry  I was thinking workflow and not forms...

0 0
replied on December 19, 2016

Ha, for a second there I was wondering if this was a new feature I missed! I did end up doing this though, you can't do a try catch but you can use a parallel gateway. Sending one path to the email activities and another to the user tasks.

0 0
replied on December 19, 2016

Actually turned out this was no use. Parallel paths don't work like I thought they would, I thought they would be 2 independent processes. If one process fails, the whole process is stopped anyways, so even if the email fails to go out the system stops all parallel processes defined.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.