You need to sign in to do that
Don't have an account?
Ray Lee 18
split the first and last name in lead
Hi,
When lead created from our web form, visitors put their full name into the FIRST NAME field.
I need a way to find how many words in the field and then split it and update it back to the first and last name field in the lead.
Here is an example when the lead created
First Name: Johnny Clark
Last Name: [not provided]
I want to split it out correctly using processes builder.
First Name: Johnny
Last Name: Clark
Does anyone have any idea? please let me know.
Thanks!
When lead created from our web form, visitors put their full name into the FIRST NAME field.
I need a way to find how many words in the field and then split it and update it back to the first and last name field in the lead.
Here is an example when the lead created
First Name: Johnny Clark
Last Name: [not provided]
I want to split it out correctly using processes builder.
First Name: Johnny
Last Name: Clark
Does anyone have any idea? please let me know.
Thanks!
Use below-defined formula is criteria, it will solve your problem.
FIND(" ", [Lead].FirstName)!= 0
If found this helpful mark as solved.
Thanks
All Answers
If its always 2 words you can split it with white space. If the user can enter more than 2 hours eg : Johnny Jack Clark in that case you have to decide which 2 words you want as first name and the remaining as last name.
Split functionality : More finormation : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm
You can achieve this functionality by Process Builder. You need to update the First Name by splitting the Name based on the white space and same need to be done for the Last Name. Below are the formulas that need to be put inside Process Builder.
FIRST NAME: LEFT([Lead].FirstName , FIND(" ", [Lead].FirstName) )
LaAST NAME: RIGHT([Lead].FirstName , LEN([Lead].FirstName)-FIND(" ", [Lead].FirstName) )
If found this helpful mark as solved.
Thanks for your formula and it works, the only problem is I need to find a way to check if the lead.firstname has " " or not before executing those action.
Without that checking in the criteria of the processes builder, if it is only one word in the first name, it will update the first name to become the last name, because those only apply when the first name must contain like "Johnny Clerk" and not "Johnny"
Does anyone know how to put the condition to check the space in processes builder formula? I tried the first name contains " " or ' ' and those get me syntax errors inside the action.
Thanks again!
Use below-defined formula is criteria, it will solve your problem.
FIND(" ", [Lead].FirstName)!= 0
If found this helpful mark as solved.
Thanks
It works perfectly and thanks you very much!
Thanks