cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Reverse a string

How can I reverse a a full name and add a comma between each word?

 

Example: ”Johan Ericsen” should be ”Ericsen, Johan”

2 ACCEPTED SOLUTIONS

Accepted Solutions
ansrikanth
Resolver III
Resolver III

something like this should work.. 

With(
    {names: Split("FirstName LastName"," ")},
    Concatenate(Last(names).Result, ",", First(names).Result)
)

obv, this presumes you have only firstname lastname (no middle names and a space between names)

 

Thank you

-Srikanth

View solution in original post

@Anonymous 

I just gave firstname and last name as an example.. like how you gave an example of "Johan Ericsen".. If I have to use your example it self in the formula then it would be .. 

With(
    {names: Split("Johan Ericsen"," ")},
    Concatenate(Last(names).Result, ",", First(names).Result)
)

Hope that clears .. 

 

Thank you

-Srikanth

 

View solution in original post

8 REPLIES 8
ansrikanth
Resolver III
Resolver III

something like this should work.. 

With(
    {names: Split("FirstName LastName"," ")},
    Concatenate(Last(names).Result, ",", First(names).Result)
)

obv, this presumes you have only firstname lastname (no middle names and a space between names)

 

Thank you

-Srikanth

Himanshu_90677
Super User
Super User

Concatenate( LastName, ", ", FirstName )

Anonymous
Not applicable

I dont't have last and first name..

Anonymous
Not applicable

I dont't have last and first name..

@Anonymous 

I just gave firstname and last name as an example.. like how you gave an example of "Johan Ericsen".. If I have to use your example it self in the formula then it would be .. 

With(
    {names: Split("Johan Ericsen"," ")},
    Concatenate(Last(names).Result, ",", First(names).Result)
)

Hope that clears .. 

 

Thank you

-Srikanth

 

Himanshu_90677
Super User
Super User

try This

Mid(User().FullName,Find(" ",User().FullName)+1) & ", " & Left(User().FullName, Find(" ",User().FullName)-1)

Anonymous
Not applicable

thank you very much!

Anonymous
Not applicable

Thank you sir!

 

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.

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 (2,904)