4 Replies Latest reply on Jan 26, 2017 5:33 PM by JackRodges

    Omit invalid email addresses?

    buck_5648798798

      Title

      Omit invalid email addresses?

      Post

            

           Hi

           I'm adding an email blast feature to an existing database. User clicks a button, a script omits empty email address fields and creates an email to the resulting found set.

           The problem is that many of the email addresses are incorrectly entered. Some have an extra space after an address. This causes the script to fail. I also found a few address fields with only a space or two. 

           Is there a way to omit records with non-valid email addresses?

           I would also like to find all non-valid email addresses so they can be fixed.

            

           Thanks

        • 1. Re: Omit invalid email addresses?
          philmodjunk

               If "invalid" means that there is a space present in the field, use this criteria to find all such records:

               " "

               And you can probably use Replace Field Contents with the Trim function in a calculation to remove leading and trailing spaces from this field.

          • 2. Re: Omit invalid email addresses?
            buck_5648798798

                  

                 Thanks!!

                 Got rid of spaces and double spaces but still the script failed.

                 It turns out that lots of the email addresses had carriage returns after them.

                 I did a search for returns and deleted them all.

                 " <press return key>  "

                 All good now.

                 Thanks again!

            • 3. Re: Omit invalid email addresses?
              philmodjunk

                   You may want to set up an auto-enter calculation on this field that filters out such characters so that user are prevented from entering such errors in the future.

                   And field behavior can be set for this field so that pressing return moves the cursor to the next field just like pressing tab and this can keep out the returns when users manually enter email addresses.

              • 4. Re: Omit invalid email addresses?
                JackRodges

                In time you will get tired of manually correcting your database and begin to learn how to make corrections using replace, find, etc.

                 

                Substitute is a wonderful tool.

                 

                Substitute(field;"PP";"") would work for above but not in all cases.

                Trim() removes blank spaces at end.

                 

                Using a table you can select a field and do a find and replace using Command+F and step through each record to validate your replace. Try this on a copy of your db to gain experience.