Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Autoselect on gallery



I have a PowerApp where in the left side there are two galleries. Gallery1 displays an item name, and Gallery2 displays cases related to the item selected in Gallery1. So one gallery filtering the other gallery. On the right side of the screen there is a form displaying the case selected in Gallery2. 


Everything works. But I have a problem, since Gallery2 does not automatically select the top item in the gallery. Sometimes there is only one case available in relation to the particular item selected in Gallery1, but it is not autoselected. It would save a lot of clicks if Gallery2 always selected the top item. 


Is there anyway to do that? 


I have tried to make the default in Gallery2 the top item by setting the default to this: First('database'.CaseNum) , but it appears not to work. The database is the items of Gallery2, and the CaseNum is where I would like the first case to be selected. 


I have attached a picture, where you can see that something is selected in Gallery1 but nothing is autoselected in Gallery2. 

Super User
Super User

Re: Autoselect on gallery



Try this code in the Item property of your form.




Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly.  If your thought the post was helpful please give it a "Thumbs Up."




Level: Powered On

Re: Autoselect on gallery

It is just returning 'No item to display' 😞

Super User
Super User

Re: Autoselect on gallery

Did you link the form to a datasource? What fields does the form contain in Edit Fields? What mode is your form being displayed in (New/Edit/View)?
Microsoft v-siky-msft

Re: Autoselect on gallery

Hi @C-Jac ,


If there is only one item in gallery, it will be auto- selected, but not when there are more than one items.

So you can try the following formulas on items property of Form:




Annotation 2019-09-23 111434.png

Although this work around doesn't make the auto-selection of gallery done, the form will always show the first item.

Hopefully this can help you.


Best regards,


Helpful resources

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.


Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,094)