First and Last Name - use one expression with :append or two expressions with space?

Is there any relevant difference I need to know about using just one expression to return the user’s First Name and Last Name, joined by :append" ", or using two expressions separated by " ", when both fields belong to the same data type?

User's First Name:append" ":appendUser's Last Name

User's First Name User's Last Name

In the first scenario, there will be no whitespace between first name and last name. If you want to display a white space then go with the second scenario.

There is actually a whitespace, as the first :append inserts a " " after the First Name and the second :append adds the Last Name.

The visual result will be the same, but what I would like to know is if there are any other relevant observations about this besides the fact that in the second case the expression is faster and easier to write.

Maybe the first case applies to data joins of different data types, as they won’t be part of the same reference belonging to the parent element’s data source?

If you’re just displaying on screen on some text element then you’re fine those are the same thing.

If you needed to like treat it as one longer text and do a find& replace or something on the whole thing then you would need to do the append, or there’s some other ways to do it too.

1 Like

In our system the last name isn’t always present. So I make the last name a separate argument: Contact’s last name is not empty: formatted as text.

If it is not empty, then it puts in a space and the last name.

If it is empty, it puts in nothing.

This avoids a trailing white space if there is no last name.

3 Likes

Makes sense, thanks @tylerboodman :upside_down_face:

1 Like

Interesting, I hadn’t thought of that. Thanks!

Arbitrary text (Current user’s first name Current user’s last name):trimmed is my current favourite

3 Likes