August 29, 200718 yr Hi everyone...I'm trying to convert an employees name and ID number to email format. The only part I'm getting stuck on is the employees name. Payroll provides it electronically as one field as such: LAST,FIRST MI, Our email is configured as [email protected] (where "F" is the first initial of the first name and "L" is the first initial of last name and 1234 is a 4 or 5 digit ID number unique to the employee). So I need to somehow take the L and F (using the example above) and place it in a calculation. Does anyone have any ideas on how to do this?
August 29, 200718 yr The comma is a word separator, as is the space. Read up on FMP's LeftWords, MiddleWords and RightWords text functions. As long as the text supplied by payroll is *always* in that format you should be OK.
August 30, 200718 yr Thanks Vaughn for the hint. I've been playing with this thing for over 4 hours. I'm terrible with text functions. (Didn't know that until today.) : Here's what I came up with. Hope it helps you AlanP. Left(MiddleWords (FullName ; 2 ; 1 );1) & ContactID & Left (FullName; 1) & "@abc.com"
August 30, 200718 yr Author I'm crying with happiness! LOL : Thank you both for your help and thank you aldipalo for providing the code as my mind is numb from trying to figure this out for too long :D
August 30, 200718 yr It looks good. My only suggestion, since I'm hopelessly risk-averse, is to introduce you to the Trim( ) function, which is built-in FMP, and the Trim4( ) custom function by Ray Cologon, found on Brian Dunning's web site. Trim( ) strips leading and trailing spaces, which are quite commonly added by data entry people. Trim4( ) removes leading and trailing spaces, non-breaking spaces, tabs and carriage returns. I include Trim4( ) in all text handling functions to clean up the input.
Create an account or sign in to comment