Forum Discussion

TonyGonzalez's avatar
TonyGonzalez
Qrew Trainee
10 months ago

Email address validation

Is there a way to force an email address field to force it to have a "valid" email address makeup?  I realize I can't actually validate the email address itself, but I want to require them to at least put in an email address in a valid format?  (I have seen this on multiple forms across the internet, of course.)



------------------------------
Gonzo - A Newbie, but learning fast. (Former SmartSheet evangelist who is quickly converting to QuickBase)
IT Director City of New Braunfels
------------------------------
  • There is not a built in function for this, but some of us have formulas squirreled away to do our own validation.  try this one

    var text email = Trim([My Email Field]); 

    // you will need to decide what to do about leading and trailing spaces.  This tends to happen with copy paste by users.  probably best to treat the field as raw input and use Trim([MyField] )  for all subsequent use of the data entry field. 

    var text Warning =If($email="", "Missing email address",

    List( "<br>",
    //If( begins($email," "), "Leading space character" ), // should not be necessary if TRIMed
    //If( ends  ($email," "), "Trailing space character" ), // should not be necessary if TRIMed
    If( not Contains($email,"@"), "Missing @ symbol" ),
    If( not Contains(Part($email, 2, "@" ),"."), "Missing .com or similar at the end" ),
    If( Contains($email, " "), "Has a space inside the email address" ),
    If(Part($email, 1,"<>[]{},")<>"", "Bad characters in in the email address"),
    If(Part($email, 2,"<>[]{},")<>"", "Bad characters in in the email address"),
    If(Begins($email,"<"), "Bad characters in email address"),
    If(Ends($email,">"), "Bad characters in email address"),
    If(Contains($email, "mailto"), "Bad email address"),
    If(Contains($email, ":"), "Bad email address" ),
    If(Ends($email, "."), "email ends in a period - that can't be right" ),
    If(contains($email, ")"), "email contains a bracket ( or ) - that can't be right",

    If(contains($email, "("), "email contains a bracket ( or ) - that can't be right" )

    ));

    If($Warning<>"", "<font color=red>" & $Warning)

     



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • DwightMunson1's avatar
      DwightMunson1
      Qrew Assistant Captain

      I'm going to have to add this to our contacts table as a custom data rule.



      ------------------------------
      Dwight Munson
      ------------------------------
      • ChayceDuncan's avatar
        ChayceDuncan
        Qrew Captain

        There is also a simple checkbox in the QB Exchange that checks for email validity for anyone that goes in there often



        ------------------------------
        Chayce Duncan
        ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      Here is their formula.  You will need to enter your own company name URL where is says mycompany

      https://mycompany.quickbase.com/nav/main/action/exchange/qb/library/check-if-an-email-is-valid

       

      [Email]="" OR not Contains([Email],"@") OR not Contains([Email],".") OR Left([Email],1)="@" OR not Contains(Right([Email],"@"),".") OR Length(Right([Email],"."))<2