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
PowerApps Staff CarlosFigueira
PowerApps 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
PowerApps Staff CarlosFigueira
PowerApps 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

PowerApps Staff CarlosFigueira
PowerApps 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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 252 members 5,052 guests
Please welcome our newest community members: