cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dBrand
Helper III
Helper III

Dropdown always goes back to top item

I have a gallery that gets it's data from a table called 'Division'. One of the fields in the table is an Account Code that is kept in another table, where that Account Code relates to an Account Name that I show in the Gallery showing tables from Division table, as a dropdown, so the user can see the Account Name instead of the cryptic Account Code. But, I only store the Account Code, not the Name in the Division Table. I use AddColumns() function to load the 'Items' to the dropdown, so I get the corresponding Account Name while populating the dropdown. I then use a Patch in the OnChange event of that sropdown, to save off the Account Code from the dropdown. But the dropdown then reverts back to the top of the list of items in the dropdown. It doesn't leave the field displaying the selected dropdown item. I can't figure out why or how to fix. Any help would be appreciated. Sample1.jpg

 

Sample2.jpg

 
5 REPLIES 5
WarrenBelz
Super User III
Super User III

Hi @dBrand ,

This is a known issue with galleries refreshing and resetting any unbound controls. Your control needs to be bound (Default) to the value in the data set you want it to display after the Patch.

 

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.

I'm unclear as to what to set the 'Default' to to bound this, as the data for this dropdown comes from another table. 

Thanks @dBrand ,

You will need to make a field in the same data set as the gallery is based on and write the value to this. The Default should then be this field. The Items can still come from the other list.

 

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.

 

@WarrenBelz  thanks for the feedback. Still having issues. Maybe need to make a collection, as using the AddColumns for the dataset doesn't work. Trying not to add the field to the database itself.

@dBrand ,

If you do not want to use a collection and not suffer from this gallery refresh bug, then you have to add the field to the data set the gallery is based on - it is the only way to retain the value shown after the Patch.

 

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.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,392)