cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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.

Highlighted

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

Highlighted

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.

 

Highlighted

@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.

Highlighted

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (11,645)