We have a form that only internal users submit. The form has a field that requests the user's email address (unauthenticated users). We keep running into the issue of people having typos in the domain section of the address or entering their personal email address by mistake. This either causes the step to fail or the email to go to their personal email address, which then causes them to have to re-submit a very long form. How can we set up a field constraint that ensures they are entering an internal email address and that there are no typos in the domain? Also, is there a way to enforce that they type their email in the following format: "firstname.lastname@domain.org" ?
Question
Question
How can I add a field constraint that validates only internal email addresses?
Answer
There are a couple of ways to do this.
1. Put a regular expression on the field to force it to be *@domain.org. This will prevent the submission unless the @domain.org part is correct.
2. Just ask the user for their first name and last name and build the email address off that. =concatenate(First,".",Last,"@domain.org"). Might not be the best idea if people use different first names in their email and casually.
3. Do a lookup to get the email from an employee database
Thank you!
1. Where would I input the regular expression for the first solution? This is the part that I have been getting stuck on.
2. Where would I input that command?
For solution 3, could we do this with the Active Directory somehow?
1. When editing the field, click the "Advanced" tab and there is a field called "Regular expression for validation" near the bottom of the window
2. Also on the "Advanced" tab, there is a section for Calculations at the top, and you would just replace First and Last with your actual variable names.
3. To use Active Directory, you would need a Data Source that can access AD data; this can be accomplished, but it is somewhat complicated because AD is not a "database."
Thank you both @████████ and @████████ I did not realize that the email address field does not allow for regular expression input and that the single line field does.
I used a modified version of the regular expression @████████ suggested in this thread: https://answers.laserfiche.com/questions/143589/Forms-email-question as well as the error message suggestion.
This is what I came up with: ^.\w+[.]\w+(@domain.org)$
Let me know if you see any potential issues with this (aside from users misspelling their own names haha).
Thanks again
If your email convention is first.last@domain, then you should be okay. Although, I'd suggest marking Jared's post as the answer since mine was really more about where to implement his suggestions.