This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Column format for First and Last Name of person table.

Hello,


How can we change the format for First name and last name columns in Person Table. We current added a Contractor from the identity manager webportal. We are using VI_Employee_Edit module to add a record to the person table . If a user enter the first name as "  JON SMITH  " by using TRIM function in the update action I removed the spaces and added the name to person table as "JON SMITH" but how can we convert the name to "Jon Smith" all I see update function only takes Upper and Lower functions. I tried the below code and i am only able to update the First name of the word to upper and other to lower case .

Function: if (len(from Person select current FirstName) > 0) then Upper (VID_Left(from Person select current FirstName ,1))+ Lower (VID_Right(from Person select current FirstName,len(from Person select current FirstName)-1)) 

Output for the abouve function is "Jon Smith"

Please suggest me how can I get the out put as "Jon Smith" .

 

Thank you.

  • I would solve this differently. You can put a formatting script on the columen Person.Firstname with Designer to convert the content to "TitleCase".

    Code would be (after googling this for 5 minutes):

    Value = System.Globalization.CultureInfo.InvariantCulture.TextInfo.ToTitleCase(Convert.ToString(Value).ToLower())

  • Thank you Markus that helped.

    This code works in most of the cases.But this is not working in some cases, like for example O'DELL or MCDONALD etc... the output must be O'Dell or MCDonald but by using the code you provided we get the output as O'dell or Mcdonald.
  • Even with your code, the output would not be correct.

    You would need a lexical correct TitleCase implementation for a specific culture you specify as many cultures handle this differently.

    You might want to take a look at Humanizer https://github.com/Humanizr/Humanizer.