Today I had an interesting question from a customer and I want to share the easy solution with you. If you use only one database column for first name and last name, you probably want the data input like this: first name last name
But maybe you got a database which is not perfect or maybe you created a personalized url with only one text input field and in the end, you might have records that look like this: last name, first name
There is an easy solution how to display first name last name, even if it is (sometimes) the other way around in the database. Let’s imagine you display a DirectSmile Set on a purl. The usual assignment would be the database column [[Name]]. You can create a rule that checks if there is a comma in the text. If yes, the Set should show the text after the comma, a space and the text before the comma. It looks like this:
Here you can try it:
The functions ‘Last part’ and ‘First part’ return the last/first part of a given string after splitting it with the specified split string. Open the assignment window (e.g. of a Set or a text variable) to use these functions.
That’s all :-) Please try it here: