Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 4VDJQyh+DOYUdaemb4NmCq
Power Apps - Building Power Apps
Answered

Extract first name from string

Like (0) ShareShare
ReportReport
Posted on 29 Nov 2019 17:12:32 by

Hi,

 

I have an issue around the identifying the app user. Chiefly as all users will be using the one device to access the apps so it will be a generic user name.

To get around this I am using an intro screen asking people to 'log-in' by entering their name - which is checked against Office 365 user list - and then navigates to a menu screen.

However, there are places within the app where I would like to use their first name rather than Selected.DisplayName

I have tried First(Split(Label1.Text," ").Result but this isn't working as it appears to want a "Sting" rather than Label1.Text.

Any ideas how I can extract the first name please.

Categories:
  • Community Power Platform Member Profile Picture
    on 30 Nov 2019 at 14:37:06
    Re: Extract first name from string

    Hi @mdevaney , thanks for this. It was the missing bracket 🙂

  • Verified answer
    mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on 30 Nov 2019 at 13:40:40
    Re: Extract first name from string

    @Anonymous 

    Can you please send a screenshot of your workspace?  I'd like to see what your app looks like and the error highlighted in the formula bar.

     

    Note: this formula was missing a close bracket

    First(Split(DataCard_UserName.Selected.DisplayName," ")).Result
  • Community Power Platform Member Profile Picture
    on 30 Nov 2019 at 11:17:35
    Re: Extract first name from string

    As an alternative solution, you could ask the user to enter a preferred name then store that in a data source (SharePoint) with their Office365 info. Then use that throughout the app? You'd only need to do this once. Just a thought

  • Community Power Platform Member Profile Picture
    on 30 Nov 2019 at 09:12:09
    Re: Extract first name from string

    Hi @mdevaney ,

     

    I'm putting the formula into the text property of a label: "Hello " & First(Split(DataCard_UserName.Selected.DisplayName," ").Result

    It's still says it's expecting text instead of DataCard_UserName? I know you can create a string using Text( but wouldn't know how or where to put it within this formula.

    DataCard_USerName is a Combo Box that checks the name against Office365 users

    Kev

  • mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on 29 Nov 2019 at 18:49:38
    Re: Extract first name from string

    @Anonymous
    Your formula strikes me as being correct but would it be possible to replace Label1.Text with a reference to the ComboBox holding the UserName instead? It should extract the FirstName

    First(Split(ComboBox_UserName.Selected.DisplayName," ")).Result

    By the way what type of control are you putting this formula into? This could also be the reason for the error

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,771 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started