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.
Solved! Go to Solution.
Fixed it by simply creating a new collection and using that one instead. The old collection must have gotten corrupted somehow. Anyways, problem solved.
Can you please share the expression on Gallery Items property that you have here?
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.
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?
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.
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.
Fixed it by simply creating a new collection and using that one instead. The old collection must have gotten corrupted somehow. Anyways, problem solved.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
203 | |
187 | |
80 | |
50 | |
38 |
User | Count |
---|---|
303 | |
249 | |
123 | |
73 | |
55 |