Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3699 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello

 

I have an email field in a Clients table that I would like to ensure has a valid email address to avoid any issues with typos and such

 

I'm not quite sure how I would go about doing this

 

Also, the field needs to be able to be empty as well

 

 

Posted

I guess im just looking to make sure that it has an "@" and a period in it.

 

I found this through google, and it seems to work well:

Let ([ L = Length ( Self ) ;                                   // get length of eMail address
         At = Position ( Self ; "@" ; 1 ; 1 ) ;                // Find at least one @ signred
         Period = Position ( Self ;"." ;L ; -1 ) ] ;           // Find at least one period from a right to left search
         At > 1 and At < ( Period - 2 ) and Period < (L - 1)   // Return boolean T/F if @ and period were found in a normal email range
       )

But how do I allow the field to be empty as well?

Posted

I guess im just looking to make sure that it has an "@" and a period in it.

 

That could be done very simply by =

 

PatternCount ( Self ; "@" ) and PatternCount ( Self ; "." ) or IsEmpty ( Self )

 

 

 

But how do I allow the field to be empty as well?

I didn't test your calculation, but I believe you could simply add:

...   or IsEmpty ( Self )

to the final line?

Posted

What I posted above seems to work for my purposes.

 

I've put it in the Validate by Calculation section for the Email Field, but again, how do I allow the field to be empty and it not return an error?


 

I didn't test your calculation, but I believe you could simply add:

...   or IsEmpty ( Self )

to the final line?

 

hmmm...I thought I tried that earlier and it didn't work, but it works now.  I must have done something wrong the first time.

 

Thanks for your help

This topic is 3699 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.