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

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (65,777)