I have a question, where I have a gallery that is (a filter of) a sharepoint list. When the Gallery's items result is changed after the filter is applied and there are results, I want to "OnSelect" the first result. I haven't found a consistent way to achieve this. It looks like the first item is selected but without triggering the commands in the OnSelect of the gallery ?
hi @bouillons im not entirely sure i understand your request but can offer this with an example.
assume you have a combobox that filter a gallery and that gallery filter another gallery. when you filter the fisrt gallery by selecting a new value, the values in the gallery change but they secon gallery still shows the previous selection's results. do get around this you can add to the combobox's OnChange = Reset(Gallery1) this way the gallery is empty and the second gallery is cleared. then when the first gallery is populated the second gallery is filter by the first record.
consider the selection
Without resetting the gallery: (the filter applies the 5 to the first gallery but the second gallery still shows the results of the previous selection, visitor 2)
With the reset of the gallery: (the second gallery goes back to visitor 1 which is the first row)
hope this helps
Thanks, I'll try this. I have a follow-up question: assuming the gallery is loaded already in memory, does the reset cause the data to be refetched from the data source ?
I still don't get the result I wanted. What I want is that whenever the content of the gallery changes, I want the OnSelect of the first item to be executed. So my question is how can I programmatically "click" the gallery's first item in the onchange event of the controls that influence the items selection of the gallery.
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.