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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Pre-Populating a Perso...
Power Apps
Unanswered

Pre-Populating a Person Field using the Email String of Another Field

(0) ShareShare
ReportReport
Posted on by 6

Hello,

 

I'm trying to pre-populate a person field based on the email entered in an input box. Below is a snippet of my edit form, table, and code. The person field is highlighted in yellow and the email string is underlined in red. Right now I am using a table that contains the person (person data type), their email (text data type), and their name (text data type).

 

When the email entered into the Associate_Director_Email input box matches the Person_Email in the table, I want it to return the matching person data type to the Associate_Director dropdown box (yellow). Any help is greatly appreciated. I can provide additional details if needed.

 

Associate_Director dropdown 'Default' code:

LookUp('Approvers List', associate_director_email.Text = Person_Email, Person)

 

Edit Form:

EQ_0-1712674554953.png

 

 

Table "Approvers List":

EQ_1-1712673606766.png

 

 

Categories:
I have the same question (0)
  • Leif_Goleman Profile Picture
    14 on at

    @EQ -
    I was able to find a fix to your issue. 


    For your "Associate_Director_Email" text field, set the OnChange property to the following so you can get the GUID of the "Approvers List" table that corresponds with the email that you type in:

    Set(
        PersonLookup,
        LookUp(
            'Approvers Lists',
            Associate_Director_Email.Text = Person_Email,
            'Approvers List'
        )
    )
     
    Note that you will need to press tab or select out of the text input to have the OnChange save the variable PersonLookup. Then, you will need to do another LookUp to the "Approvers Lists" table (be careful here and note that you are using the plural version of Approvers List with an "s") by setting the Item of the Form to:
    LookUp(
        'Approvers Lists',
        PersonLookup = 'Approvers List'
    )

    This should populate the form with the data from the Approvers List table.

    Please give a thumbs up if I was able to help you resolve your problem and thanks!
  • EQ Profile Picture
    6 on at

    Thanks for the reply!

    1. When I enter the OnChange code into the Associate_Director_Email (the final parenthesis gets cutoff in the pic) I get an error saying 'Incompatible types for comparison'. I don't understand how these aren't compatible since the input is text and the Person_Email is text.

    EQ_0-1712748276147.png

     

    EQ_1-1712748455208.png

     

    2. When I enter the Item code into the Form I get an error code saying the types can't be compared.

    EQ_2-1712748790299.png

     

    3. When the Item code is in the Form I get the "No item to display" text. I tried putting "Defaults('Original Table');" before the code you provided but that does not help displaying the edit form.

     

    EQ_3-1712748919585.png

     

    Any further help is appreciated, thanks for your effort.

  • Leif_Goleman Profile Picture
    14 on at

    I really want to help here, but I need a question answered first:
    Does the form have only one data source connected to it? If so, is it just the "Approvers List" custom table you created?

  • EQ Profile Picture
    6 on at

    The form is connected to another SharePoint table data source. The Approvers List (SharePoint) and another list that populates the titles of the cards in the form. This other list is what will be populated when the form is submitted. The Approvers List is a set of names and their corresponding email.

  • Leif_Goleman Profile Picture
    14 on at

    One more question: Is this the SharePoint Custom form or is this a canvas app that you are working on?

  • EQ Profile Picture
    6 on at

    It's a canvas app. The SharePoint custom form didn't provide enough functionality for our needs.

  • Leif_Goleman Profile Picture
    14 on at

    @EQ , I have another solution for you:

     

    OnChange of the Associate_Director_Email text field:

    Set(
        PersonLookup,
        "Name of your text data card for Associate_Director_Email".Text
    )
     
    Finally, for the Item property of your form:
    LookUp(
        'Approvers List',
        PersonLookup = Person_Email
    )
    Let me know how that goes!


    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard