cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
acolyter
Helper II
Helper II

Autofill (pre-populate) form data from dropdown selection

Hi,

 

I have a problem with autofilling (pre-populating) information based on Microsoft Lists record. First, I created a Canvas app in PowerApps. I then created a dropdown and other form attributes. Based on selected value in dropdown, PowerApps form is automatically looking up Microsoft list record and auto fill the other form attributes.

 

 The problem is, when there is only one record in that dropdown, it doesn't work. Even if I click on it, still nothing, it stays empty. Every time I load the app I need to select different value so it starts working. 

 

Any solution for this? 

 

Thanks!!

1 ACCEPTED SOLUTION

Accepted Solutions

@acolyter ,

 

Have you set-up the AllowEmptySelection of the dropdown to true? If no, if you have only 1 value in the dropdown, it will always be displayed by default and there is no way to change it so you can trigger the OnChange event.

View solution in original post

4 REPLIES 4
PTBBSolutions
Solution Supplier
Solution Supplier

Hi @acolyter ,

 

Can you please provide some code examples and some screenshots of your set-up to better understand what the issue is?

 

What is the source of the dropdown?

@PTBBSolutions 

 

Hi, 

 

thank you for your reply. 

 

The source is Sharepoint List and the column is a single line text called 'Name'. 

 

The dropdown has 2 settings - Items is set to: 

 

Distinct(Filter(Catering, StartDate > Now() And Organizer.Email = User().Email), Name)

 

On change is set to:

 

Set(UdalostVar,LookUp(Catering, Name = UdalostDDL.Selected.Result))

 

 

When there's 2 or more items in the list (so there's 2 or more in the dropdown menu), everything works just fine. When I select the name, it automatically pre-populates other fields. But when there's only 1 record in the dropdown menu, even if I click on that event, nothing happens (the fields that should become pre-populated stay blank).

 

Thanks!

@acolyter ,

 

Have you set-up the AllowEmptySelection of the dropdown to true? If no, if you have only 1 value in the dropdown, it will always be displayed by default and there is no way to change it so you can trigger the OnChange event.

Perfect, that works, thank you! 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,595)