Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

can't find a custom function-- email "From" parser

Featured Replies

This must exist, but I haven't been successful at finding it.. Has anyone seen a custom function that will parse the "From" field in an email ?

"Full Name"

to-->

first name:

last name:

email address:

The tricky part is that Full Name can be

last, first

first last

first initial last

first mi. last

etc.

I'm writing something that takes a good guess at this, and realize nothing will be perfect because of the crap in crap out rule.. (if a person has "yoda" in for their full name, my function will fail.. but I want to take the best possible stab?

Am I reinventing the wheel and if so, can someone point me to it ?

thanks :)

Since there seems to be no way to determine what order the name appears, you're likely to get more bad data than you want.

Its not difficult to separate any words in a "full name" but I don't know how you can determine which is the first, middle or last.

  • Author

Something like this does the trick.. about 90-95 % of the time

to parse/guess the First Name out..




Let (



  [ 



   Lquot = Position(From; """; 1; 1);

   Rquot = Position(From; """; 1; 2);

   Lbrac = Position(From; "<"; 1; 1);

   Rbrac = Position(From; ">"; 1; 1);

   Name = Middle(From; Lquot+1; Rquot-(Lquot+1));

   Email = Middle(From; Lbrac+1; Rbrac-(Lbrac+1));

  comma = Position(Name; ","; 1; 1)





        ]; 



Case(

     PatternCount(Name;",") >0 ;

     Middle(Name; comma+2; (Rquot-(comma+2)));

     LeftWords(Name; 1)

        )

)

My situation is one where the data entry person will have to check the name anyway, so parsing this and dumping it onto a layout will be a bit timesaver.

Are there any problems with this code?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.