cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

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
Highlighted
Power Apps
Power Apps

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
Highlighted
Power Apps
Power Apps

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

Highlighted
Power Apps
Power Apps

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))
Highlighted
Community Champion
Community Champion

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,697)