formula help with truncating text

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I am looking for help with yet another formula that can be used to truncate the text of a text field.   I've tried the right/left and trim, but my results are never consistent. 

The original field is a synced body field from a table connected to Gmail.  Because these emails come from a third party service, the "from" field or email address does not accurately reflect the client email address which is contained in the email body.

E.G. - the body field always returns the following: 

FIRST NAME xxxx Last Name xxx Phone (get help now!) ########## Email xxx@xxxx.com Your Message xxx.

I need the formula to return only: xxx@xxxx.com

Any help would be greatly appreciated. 

Thanks.
Photo of Kaisa Janzen

Kaisa Janzen

  • 250 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
I tested this and it seem to work.  It does rely on the assumption that the fiel only has one @ in it and users are not tup;ing messages like

Please order me 5 widgets @ $10 each.

Here is the formula


var text AfterAt = Right([gmail text],"@");
var text AfterAtUpToSpace = Left($AfterAt," ");

var text BeforeAt = Left([gmail text],"@");
var text BeforeAtUpToSpace = Right($BeforeAt," ");

List("@", $BeforeAtUpToSpace, $AfterAtUpToSpace)
Photo of Kaisa Janzen

Kaisa Janzen

  • 250 Points 250 badge 2x thumb
Thank you so much!!! This works perfectly.  You're amazing.