Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Auto-populate person field based on another field value entered

(0) ShareShare
ReportReport
Posted on by

I'm fairly new to Power Apps and learning as I build.

 

I have a form that users will submit periodically. The project information will stay the same while the reporting fields will change. After the first time they submit the form for a project, I want the project information to auto-populate. I'm using a SharePoint list as my data source. So far, I have been able to use the LookUp function in the Default property of the text, date, and choice fields and haven't had any issues. As an example, I set the Default property of the Title field to:

LookUp(DataSource, ProjectCode=DataCardValue2.Text, Title).

 

I'd like to have the form also auto-populate a person field based on the project code text field (for example, when a project code is entered, I want the project manager to auto-populate), but I get the following error when I attempt the same syntax as above:

"Expected Record value.

The property on this control expects Record values. The rule produces Table values which are incompatible."

 

Are there extra steps I need to take to auto-populate a person field like this? Is it possible to auto-populate it based on a text field?

Categories:
  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Auto-populate person field based on another field value entered

    Hi @Esaki_28 ,

    You need the Combo Box output at OutputHere (DataCardValue10.Selected.????), but from what you have posted, this may be what you are after

    {
     OutputHere:
     If(
     'New Task'.Mode = FormMode.New,
     Filter(
     Activities, 
     Project in DataCardValue10.SelectedItems
     ).'Activity Name'
     )
    }

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Esaki_28 Profile Picture
    8 on at
    Re: Auto-populate person field based on another field value entered

    Hi @WarrenBelz ,

    Auto-populate field with choice data type based on another field value selected with choice data type

     

    I have a form that users will create. In this table I am having two fields having one-many relationship, Now I want to populate one field value based on another field value. 

     

    I tried this formula in DefaultSelectedItems : If('New Task'.Mode = FormMode.New,LookUp(Activities, Project = DataCardValue10.SelectedItems,'Activity Name')

     

    But I received this error : "Incompatible types for comparison. These types can't be compared: Record, Table."

     

    Looking forward for your support.

  • Esaki_28 Profile Picture
    8 on at
    Re: Auto-populate person field based on another field value entered

    Hi @fhamm,

     

    Provide that fixed code.

  • fhamm Profile Picture
    on at
    Re: Auto-populate person field based on another field value entered

    Thank you! That fixed it!

  • Verified answer
    WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Auto-populate person field based on another field value entered

    @fhamm ,

    You need to treat DefaultSelectedItems as a Table 

    {DisplayName: LookUp(DataSource, ProjectCode=DataCardValue2.Text, ProjectLead.DisplayName)}

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • fhamm Profile Picture
    on at
    Re: Auto-populate person field based on another field value entered

    At one point, the second syntax that I tried -- LookUp(DataSource, ProjectCode=DataCardValue2.Text, ProjectLead.DisplayName) -- did work, but it broke at some point. I also tried it in a new form and received a new error:

    fhamm_0-1675901141879.png

     

  • fhamm Profile Picture
    on at
    Re: Auto-populate person field based on another field value entered

    I tried different syntax and received a new error:

    LookUp(DataSource, ProjectCode=DataCardValue2.Text, ProjectLead.DisplayName) and got the following error:

     

    "Incompatible types for comparison. These types can't be compared: Text, Control."

     

    The person field Project Lead is multiple select. I'm trying to lookup the Project Lead value in the same table as the Project Code value.

     

    For context, this form is collecting data from the same project(s) over multiple months. I don't want users to have to enter data that remains the same over the course of the year and only have to enter data that changes per month. I want to lookup the Project Lead person field based on Project Code in the same table, looking for an earlier entry. I was able to do this with other field types pretty easily, but keep running into problems with the person field type.

  • fhamm Profile Picture
    on at
    Re: Auto-populate person field based on another field value entered

    Sure, here's the screenshot:

    fhamm_0-1672414893193.png

    In the DefaultSelectedItems property, I have the following:

    LookUp(DataSource, ProjectCode=DataCardValue2.Text, ProjectLead) with ProjectLead being the person field that I want auto-populated based on the ProjectCode text field.

  • v-dezhili-msft Profile Picture
    Microsoft Employee on at
    Re: Auto-populate person field based on another field value entered

    Hi @fhamm ,

     

    Could you please provide some screenshots of the error message?
    Is your Person column multi-select?
    In my test, my three items are stored in list3. When adding a new item in list2, as long as you enter an existing item in list3, the manager will be automatically filled in the person field in list2.

    vdezhilimsft_1-1672369826355.pngvdezhilimsft_2-1672369847233.png

     

    vdezhilimsft_0-1672369808818.png

     

    Best Regards,

    Dezhi

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard