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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

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 (8,890)