web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / auto fill text field f...
Power Apps
Answered

auto fill text field from display name

(0) ShareShare
ReportReport
Posted on by 313

Hi all,
Thank you for taking your time to look at my question.
i making a sharepoint list that have firstname, lastname, DisplayName, emailaddress etc.

I have done using Concatenate firstname and lastname to do for display name.

How can i have it auto fill with either Displayname or First Name & Last Name, and without spacing in each word.
For example.
First Name : Peter John
Last Name : Leong
Display name : Peter John Leong

Email address : peterjohn.leong@emaildomain.com

Thank you

Categories:
I have the same question (0)
  • Digital Profile Picture
    1,207 on at

    For first name from display name

     

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

     

    For last name

    Last(Split(DisplayName," ")).Result
  • Wei Ming Leong Profile Picture
    313 on at

    HI Digital,
    that does not work the way i want.
    the outcome should be 

    firstname.lastname@emaildomain.com

  • Digital Profile Picture
    1,207 on at

    Probably a more elegant way but it works for two names and three names.

     

    With(
     {
     wNumberOfNames:CountRows(Split(Label2.Text," "))
     },
     If(
     Mod(wNumberOfNames,2) = 0,
     Concat(Split(Label2.Text," "),Result,"."),
     Replace(
     Concat(Split(Label2.Text," "),Result,"."),
     Find(
     ".",
     Concat(Split(Label2.Text," "),Result,".")
     ),1,""
     )
    
     )
    
    )
    & "@domain.com"

     

    Peter John Leong will become PeterJohn.Leong@domain.com

     

    Peter Leong will become Peter.Leong@domain.com

     

    This solution is only for display name with up to three names

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @WeiMingLeong,

    Do you want to auto fill email address based on first name and last name?

    Could you please share a bit more about the scenario?

     

    Not sure where you operate this action, in a Form? I just assume that you want to auto fill the EmailAddress field based on the first name and last name.

     

    Set the Text Input Default property or Label Text property as below:

    Concatenate(
     Concat(
     Split(
     Label6.Text,// Here displays the first name
     " "
     ),
     Result,
     ""
     ),
     ".",
     Label7.Text,// Here displays the last name
     "@emaildomain.com"
    )

    Note that you could replace the Label name with your real text control name.

    vqiaqimsft_0-1635492483211.png

  • Wei Ming Leong Profile Picture
    313 on at

    Hi Qi, Thank you for your reply.
    this formula work.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard