cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jason_Hough 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
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
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

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
Meneghino 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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (8,815)