Hi,
So in my Apps I like to prepoulate text in label, for example "Hi my name is" & ThisItem.'Created By'.DisplayName & " nice to meet you". (Or along those lines).
But in these scenarios it shows surname first, so doesnt read a well. Is there a way to show first name first then surname?
Thanks in advance.
This is dependent on how your organization has set the display of names - first last, or last, first.
However, if you want just the given name of the user, then you can utilize the Office365 User connector to get the full user information. That information includes the given and surname separated.
I hope this is helpful for you.
Is it showing as:
Surname, Forename
If your data source offers Given Name/Forename and Surname separately, use these, else you could do the following:
With(
{
seperator:
Find(
", ",
ThisItem.'Created By'.DisplayName
)
},
Concatenate(
Mid(
ThisItem.'Created By'.DisplayName,
seperator + 2
),
" ",
Left(
ThisItem.'Created By'.DisplayName,
seperator - 1
)
)
)
Or for the less complicated version 🙂
Last(
Split(
ThisItem.'Created By'.DisplayName,
", "
)
).Result
& " " &
First(
Split(
ThisItem.'Created By'.DisplayName,
", "
)
).Result
Or
With(
{
arr:Split(
ThisItem.'Created By'.DisplayName,
", "
).Result
},
Last(
arr
).Result
& " " &
First(
arr
).Result
)
Or a slightly easier way to write that...
With({_names: Split(ThisItem.'Created By'.DisplayName, ",")},
Trim(Last(_names).Result) & " " & First(_names).Result
)
User | Count |
---|---|
255 | |
110 | |
90 | |
51 | |
44 |