Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

How to hide a Edit.Form as long as no Gallery Item is selected


I was looking hours to find a solution... but failed...


I have build a tablet app. Connected to SharePoint. On the Screen I have added a Gallery1 and directly next to it a Form.Edit. (I do not want to add a View Form!)


Somehow I cannot tell the Gallery that the first item in the Gallery gets selected automatically by browsing to that Screen, so there is no item selected. The Form.Edit is displayed as a edit form without NO content, so if people are not recognizing that they are not in a "selected" item, they start update the record - which is of couse not working....


I am aiming for a solution that either the first item in the gallery gets selected automatically OR the Form.Edit is NOT visible till an item in the Gallery gets selected.


Gallery "Item" is set to: SortByColumns(SystemPerformance;"Issue_x0020_Date";Descending)

Form.Edit "Item" is set to: GalleryPerformance.Selected


I have tried a lot, with Default / First / If / but all has failed. I have also tried to have a text field inserted and make this visible until a Gallery Item gets selected, but with that I failed too.


Please be so kind an come back to me with formula - this would be great.

Any help is vey much appreciated. Thanks.


If the two tables have the same columns then.


ClearCollect(MyCombinedTable, Filter(Table1, SomeColumn = SomeValue)); Collect(MyCombinedTable, Filter(Table2, SomeColumn = SomeValue))


Now MyCombinedTable has all of the rows from both tables that match your query. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

@Shanescows wrote:

I am guessing something you changed is causing this. No problem, we will ignore it, and make your form act the way you want in this scenario. 


  1. For your Display Form set the Visible property to ShowMyForm
  2. In your Gallery. Change the > icon to be Select(Parent);UpdateContext({ShowMyForm: true})
  3. For the Screen that these items are on: change the OnVisible property for the screen to UpdateContext({ShowMyForm: false})

All done. 


To enhance the app a little I would add a Label that says "please select an item to see the details" and put it in the same spot as the display form. Then set the labels Visible property to !ShowMyForm How Fancy is that?


Does that work for you?




Hi Guru @Shanescows , 


Could you show me how its done? i need the same thing, but i already in view form and need to hide it when user click the edit icon (at the same time show the edit form for them to edit).


Thank you.


Ps. I'm a super noob in powerapss BTW.  


@Shanescows, quick follow up question.

On the Gallery, I have TemplateFill set to:


If(ThisItem.IsSelected, DarkOrange, Transparent)


When I navigate to this screen from a different screen, one of the gallery items is always "selected" (according to IsSelected logic), i.e. the item is highlighted (so it looks like it is selected), but the form is not visible until I actually physically click on the item.

How can we either make sure that it's either:

  1. Not highlighted (and highlighted only when we click on it),
  2. Or if something truly IsSelected (according to ThisItem.IsSelected logic), the form is visible?

Helpful resources

PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,054)