cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dBrand
Resolver I
Resolver I

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
Super User

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
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 (2,440)