cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Blank rows at bottom of Gallery connected to Collection and SQL table

Every time I switch views to display the view that contains a Gallery connected to a Collection, the view displays an extra blank row at the bottom of the gallery. There is a new blank row at the bottom every time I switch back to this Gallery view. Any idea why this is happening? Adding a condition to the Gallery's visible property to hide rows with blank values does not hide these extra rows. I have verified there are no extra rows in the SQL table behind the Gallery's Collection, so these are being created by the app somehow.Untitled.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Blank rows at bottom of Gallery connected to Collection and SQL table

Fixed it by simply creating a new collection and using that one instead. The old collection must have gotten corrupted somehow. Anyways, problem solved.

View solution in original post

6 REPLIES 6
PowerApps Staff ShantanuP
PowerApps Staff

Re: Blank rows at bottom of Gallery connected to Collection and SQL table

Can you please share the expression on Gallery Items property that you have here?

Anonymous
Not applicable

Re: Blank rows at bottom of Gallery connected to Collection and SQL table

Ok, this is a bit complicated, but the Gallery is first populated by a button expression that is on a different view that shows when the app is first opened, before switching to the Gallery view. that expression is below. Basically, the expression checks the values of the ExtraToggle and StatusToggle controls, and if either of them is 'true' then it filters the MasterIssuesLog database according to the values selected in the StatusDropdown and ExtraDropdown controls.

 

If(StatusToggle.Value = true && ExtraToggle.Value = false, ClearCollect(Collection2,Filter('[dbo].[MasterIssuesLog]',Project=ProjectDropdown.Selected.Value && IssueStatus=StatusDropdown.Selected.Value)),StatusToggle.Value = false && ExtraToggle.Value = true, ClearCollect(Collection2,Filter('[dbo].[MasterIssuesLog]',Project=ProjectDropdown.Selected.Value && Extra=ExtraDropdown.Selected.Value)), StatusToggle.Value = true && ExtraToggle.Value = true, ClearCollect(Collection2,Filter('[dbo].[MasterIssuesLog]',Project=ProjectDropdown.Selected.Value && IssueStatus =StatusDropdown.Selected.Value && Extra=ExtraDropdown.Selected.Value)), ClearCollect(Collection2,Filter('[dbo].[MasterIssuesLog]',Project=ProjectDropdown.Selected.Value)));Navigate(ListScreen,ScreenTransition.Fade)

 

The Gallery items property is simply set to Collection2.

 

 

PowerApps Staff ShantanuP
PowerApps Staff

Re: Blank rows at bottom of Gallery connected to Collection and SQL table

Does this occur if you use any of the 3 ClearCollect expressions? Just to seperate out the issue, can you check which of the clearcollect expression adds extra row? Is it possible that you have an entry in '[dbo].[MasterIssuesLog]' which matches project name but doesn't have any values for other fields?

Anonymous
Not applicable

Re: Blank rows at bottom of Gallery connected to Collection and SQL table

Ok, I simplified the button expression to just the following for troubleshooting purposes:

 

ClearCollect(Collection2,'[dbo].[MasterIssuesLog]');Navigate(ListScreen,ScreenTransition.Fade)

 

So, just one ClearCollect function and one Navigate function.

 

I am still seeing the same behavior: every time I Navigate to the Gallery view (which is on the ListScreen screen) there is a new blank row added to the bottom of the gallery. For example: the first time the Gallery is displayed, after clicking the button with the expression above, there is 1 extra blank row. Then if I view the details for one of the gallery items and afterwards navigate back to the Gallery view, there are now 2 extra blank rows. So basically, every time the app loads the screen with the Gallery, there is a new extra blank row on the bottom. This makes me think it's not related to the database (which I have double checked contains no blank rows) but rather to the app functionality.

Anonymous
Not applicable

Re: Blank rows at bottom of Gallery connected to Collection and SQL table

Additional troubleshooting: I added a button on my Gallery screen with the following expression:

 

Remove(Collection2,First(Filter(Collection2, Title="")))

 

This was an attempt to remove a blank record/row from the gallery, but it didn't work: when I click this button nothing happens, there are just as many blank rows as before. This makes me think there is something going on with the UI that displays blank records/rows that are not actually in Collection2.

Anonymous
Not applicable

Re: Blank rows at bottom of Gallery connected to Collection and SQL table

Fixed it by simply creating a new collection and using that one instead. The old collection must have gotten corrupted somehow. Anyways, problem solved.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 155 members 5,497 guests
Please welcome our newest community members: