A READER ASKS: Get The Email Domain String In FileMaker?

From Dwayne Wright PMP
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit or other formatting of the posting may fail. For the best experience, please visit the journal directly by clicking (here).

A READER ASKS
I found your site through a Google search. I want to create a new field that trims just the domain.com part of an email address into it's own field. I'm confused on the proper syntax. Can you point me to a resource? Thanks!


DWAYNE RESPONDS
Well, if you have an email address field, you will want to focus on the @ symbol that proceeds the domain name. You can use the position function to find where the @ character is in the string, found out how long the string is and then use the left and right functions to return just the data to the left or right of the @ symbol.

For example, the following tells you where the @ character is ...
Position ( email ; "@" ; 1 ; 1 )

This tells you to get everything to the right of the @ symbol ...
Right ( email ; Length(email) - Position ( email ; "@" ; 1 ; 1 ) )

Here are some links to other posts that might be of interest in regards to this topic...
The Left, Leftvalues And Leftwords Functions
The Position Function
The Length Function

Now if you are using FileMaker Advanced, you might want to use a custom function for this. Here are some links I found that were interesting and domain related ...

getDomain
eParse ( text )
GetEmail ( text )
IsValidEmail ( theEmail )

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.