Brian Dunning's FileMaker Custom Functions

ParseName ( name )

Parses a name into a JSON object

  Average rating: 5.0 (1 vote) Log in to vote

Richard Dyce   Richard Dyce - Show more from this author
Dyce & Sons Ltd.
http://dyce.com

Share on Facebook Share on Twitter

  Sample input:
ParseName ( "Dr Sara-Louise M Pleydell-Smith Msc PhD" )
  Sample output:
{"forename":"Sara-Louise","initials":"M","suffix":"Msc PhD","surname":"Pleydell-Smith","title":"Dr"}

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

I use this to simplify data entry - let the user enter a full name, and then pull it into sub fields using FileMaker's JSON functions.

I *think* I've covered most standard cases - but the genitives list, titles, and suffices can easily be expanded.

 

Comments

Joshua Willing   Joshua Willing, Willing Apps
Apr 21, 2019
Parsing names is dicey business. Good luck!
 
Joshua Willing   Joshua Willing, Willing Apps
Apr 21, 2019
you might wanna consider roman numerals in suffixes e.g. William Henry Gates III
 
Richard Dyce   Richard Dyce, Dyce & Sons Ltd.
Apr 22, 2019
I might ;-)

Adding them would be easy - simply append them to the suffix list:

suffices = "Jr¶Sr¶PhD¶MD¶JD¶DDS¶MBA¶CPA¶CEO¶CFO¶CTO¶CTO¶COO¶BA¶MSc¶BSc¶MEng¶BEng¶I¶II¶III¶IV¶V¶VI" ;


Strangely, it's not that much of a big deal here in Europe, at least for non-Royalty ;-)
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: