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 / Using the information ...
Power Apps
Answered

Using the information logged in to the application form, select my name as the default

(0) ShareShare
ReportReport
Posted on by 321

 

Bingqiling_0-1694044424457.png

 

In the dataverse, there are name and mail fields in the 'User' table,
There is an applicant field in the 'application' table, and these two tables are connected and used.
I want to set this up so that my name, which is logged in by default, appears automatically in the applicant field on the application form in Power Apps without being searched.
Currently, applicant is a combo box that lists all employees in the User table.
What should I do?

Categories:
  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @Bingqiling ,

     

    In the DefaultSelectedItems property of the DataCardValue, use:

     

    If(
     Form1.Mode = FormMode.New, //change Form1 to your Form name
     First(
     Filter(
     Users,
     'Primary Email' = User().Email
     )
     ),
     Parent.Default
    )

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • Bingqiling Profile Picture
    321 on at

    Unbelievable!! Thank you so much😍😘

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @Bingqiling - I do not know what a "noti" field is, but I assume it is the name of a People field in your custom Dataverse table.

     

    It would not be possible to enter a users name into a Combo Box as free text for example, because the field type is expecting a record. A record includes multiple attributes and some of those attributes are mandatory (internal e-mail address, system user id). This is the reason search is required in order to select the correct record.

     

    If you want to enter a specific user, you can simply hardcode the email address of the specific user with e.g.:

     

    If(
     Form1.Mode = FormMode.New, //change Form1 to your Form name
     First(
     Filter(
     Users,
     'Primary Email' = "imran.khan@microsoft.com"
     )
     ),
     Parent.Default
    )

     

    Alternatively and depending on what you're trying to do, you can create a variable and then supply the variable to the DefaultSelectedItems property:

     

    Set(
     varSpecificUser,
     First(
     Filter(
     Users,
     'Primary Email' = "imranami@imranamikhan.onmicrosoft.com"
     )
     )
    )

     

    If(
     Form3.Mode = FormMode.New,
     varSpecificUser,
     Parent.Default
    )

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

  • Bingqiling Profile Picture
    321 on at

    @Amik  Thank you so much. I solved it with the first answer!!
    However, I would like to receive the applicant's information and retrieve the applicant's department information from the details page. At this time, the department information is not in the User table, so I would like to retrieve the department information using Office365User. Is this possible?

    (if User.mail = Office365.Mail)

    Bingqiling_0-1694062319045.png

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Bingqiling yes this is easily possible. Apply the below to a Label for example:

     

    Office365Users.UserProfile(User().Email).Department

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

  • Bingqiling Profile Picture
    321 on at

    Bingqiling_0-1694136162339.png

    Office365Users.UserProfile(applicantName.Selected.'기본 메일 주소').Department

    An error occurred in the code you provided...ㅜㅜㅠ

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Bingqiling - what is the error message in English?

  • Bingqiling Profile Picture
    321 on at

    'UserProfile' is an unknown function or an unsupported function in the namespace 'Office365Users'.

     

    like this...

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Bingqiling - I suspect you have not added the Office 365 Users connector.

     

    Amik_0-1694163208757.png

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard