Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to Validate Email Field

Monica
Contributor
October 31, 2024

I am using ConfiForms and need to add a validation rule. When a user enter an email address that does not end with ".mil" I want the validation rule to display error message.
I need assistance building the regex to do this validation.
Thank you.

2 answers

1 accepted

3 votes
Answer accepted
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 31, 2024

Add a validation rules that checks that in a condition

!*.mil

No need for the regular expression if you want to check only that the text ends with a .mil

Monica
Contributor
November 1, 2024

Hi @Alex Medved _ConfiForms_ this works great but I need to make this part of a rule because it will need to work in conjuction with another check. See I have a checked ration button called DoD, so if the user select Yes for the DoD button then the email address MUST end with ".mil". 

The code you gave me is great for the validation within the field definition, but when I add it to a rule it is not getting picked up, not sure what I am missing. Here is what I have so far

image.png

image.png

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 1, 2024

Extend the condition to include the check for the radio button field

something like 

Myradio:DOD AND !TestMil:.mil
Monica
Contributor
November 1, 2024

Thank you so much!!!! I had the "!" on the wrong spot :-)

Like • Alex Medved _ConfiForms_ likes this
0 votes
Monica
Contributor
December 2, 2024

@Alex Medved _ConfiForms_ following on this one, I have to add a second check, and it is failing. Does ConfiForms not like "OR"? see my code below:

Action:create AND RequestorDoD:Yes AND (!RequestorEmail:*.mil) OR (!RequestorEmail:*@nsa.gov)

Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

When this should trigger? 

If I understand your intent right then it should be something like this

Action:create AND RequestorDoD:Yes AND !RequestorEmail:*.mil AND !RequestorEmail:*@nsa.gov

 

Monica
Contributor
December 2, 2024

So, when the user tries to submit the form, if they are creating an account (Action:create) and they selected "yes" for DoD (RequestorDoD:Yes) then their email address must end with EITHER "*.mil" or "*@nsa.gov"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events