cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Jason_Hough
Level 8

How to get users initals into a label

Hi there I can easily get my full name in a label by going User().FullName - but how would I get my initals (so my name is Jason hough - and initials will be JH) ?

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: How to get users initals into a label

If the name only has two parts (first / last), then you can use the formula below:

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

The first part takes the first character (initial of the first name); the second part first finds the first space within the full name, then takes the first character after that space.

 

If you have name with multiple parts (e.g., Barack Hussein Obama => BMO; George W Bush => GWB), then there's no simple way to get the initials - we need a function to split a string into a table/collection, and this doesn't exist. If this is your scenario, please consider upvoting this feature request in the PowerApps Ideas board.

View solution in original post

3 REPLIES 3
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: How to get users initals into a label

If the name only has two parts (first / last), then you can use the formula below:

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

The first part takes the first character (initial of the first name); the second part first finds the first space within the full name, then takes the first character after that space.

 

If you have name with multiple parts (e.g., Barack Hussein Obama => BMO; George W Bush => GWB), then there's no simple way to get the initials - we need a function to split a string into a table/collection, and this doesn't exist. If this is your scenario, please consider upvoting this feature request in the PowerApps Ideas board.

View solution in original post

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: How to get users initals into a label

The latest PowerApps release now has a Split function, which can be used to solve this problem in a more generic way:

Concat(Split(User().FullName, " "), Left(Result, 1))
Meneghino
Level 10

Re: How to get users initals into a label

Great news about the new Split function.  In addition to what @CarlosFigueira said, I would use this approach wherever you use the User() function, otherwise app perfomance may suffer.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,938)