Forum Discussion

KaisaJanzen's avatar
KaisaJanzen
Qrew Cadet
7 years ago

formula help with truncating text

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.

2 Replies

  • 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)