cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimboSey
Helper V
Helper V

Name showing surname first, is there a way to change?

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.

3 REPLIES 3
RandyHayes
Super User
Super User

@JimboSey 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
sgtsnacks64
Resolver I
Resolver I

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
)

 

RandyHayes
Super User
Super User

@sgtsnacks64 

Or a slightly easier way to write that...

With({_names: Split(ThisItem.'Created By'.DisplayName, ",")},
     Trim(Last(_names).Result) & "  " & First(_names).Result
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,168)