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 Lookup Funct...
Power Apps
Answered

Using the Lookup Function to Auto Propagate form fields based on a selected user

(0) ShareShare
ReportReport
Posted on by 70

Hey there!

I am struggling to find a solution that works for what I'm trying to do

 

I have a SharePoint list that is updated using a Power App, the power app uses an employee lookup drop-down for an "Employee Name" field in the SharePoint list.

 

Ideally, I would like it so that when the employee name field is selected, IF their record exists in the SharePoint list: I want the existing form fields to be propagated with their existing data.

I know this means that I'd possibly need to have an OnChange control and then a LookUp for the information, but I am struggling to write the call out and make it work with my current knowledge/skills

Right now I'm playing with LookUp('IT Deskside Onboarding CheckList','Employee Name'.DisplayName = ????)​

No matter what fields or information I try it doesn't seem to work.

 

I'm hoping the community might have some guidance in the right direction for me

 

Previsible_1-1716406675242.png

 

 

Previsible_0-1716407111148.png

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @Previsible - you will need to create a separate ComboBox outside of the EditForm control.

     

    You can then apply the below to the Item property of your EditForm control:

     

    LookUp(
     'IT Deskside Onboarding CheckList',
     'Employee Name'.Email = ComboBox1.Selected.Email
    )

     

    Please be mindful if you have duplicate employees in your 'Employee Name' field, he LookUp function will return the first matching record.

     

  • Previsible Profile Picture
    70 on at

    Thank you so much! As soon as I set the form to edit after making these changes it worked like a dream!

  • Previsible Profile Picture
    70 on at

    Unfortunately now though, since the form is set to edit, when I view the form it shows:

    "no item to display"

    Do you happen to know how I would work defaults into this formula to avoid that?

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

    @Previsible - irrespective of whether the Form Mode property is in View Mode or Edit mode, the "No Item to display" notification should only appear if the Item property cannot identify a record. If you select a person from that ComboBox, and the selected person exists in your SharePoint list, does the message continue to appear?

  • Previsible Profile Picture
    70 on at

    No, but I want the ability to submit new records as well as review existing, so not being able to do both is somewhat detrimental to what the app needs to do.

     

    Approaching it from a different angle, would it be better to perhaps edit each form control with an IF statement?

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

    @Previsible - then I would simply add a Button control into your Screen and on the OnSelect property, enter:

     

    NewForm('Your Form')

     

    And on the OnChange and OnSelect property of your ComboBox, enter:

     

    EditForm('Your Form')

     

    However, if we focused on what you're ultimately trying to do, why not simply add a Gallery control into your App and link it to the same data source as your EditForm. 

     

    On the OnSelect property of the Gallery control, you could use:

     

    EditForm('Your Form')

     

    And on the Item property of your Edit Form control, you can use:

     

    Gallery1.Selected

     

    You will still need to keep the New Form Button however.

  • Previsible Profile Picture
    70 on at

    The Gallery is really large and because I didn't develop the original underlying apps there are some things which aren't working correctly with the gallery callouts. 

    I believe with the departure of the previous BA this entire app will require an overhaul 😑

    This was exactly what I needed though, thank you I appreciate it!

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 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard