cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fsim
Helper II
Helper II

how to show an empty row in a gallery based on a collection ?

Hi !

 

I'm working on my second app and once more it's a parent/child SQL table based app. Basically I have the header (above) and the lines below. The Lines are shown using a gallery based on a collection that is initialized when the header is selected with this code.

     ClearCollect( Mylines, Filter( '[CIT].[ProjectLine]',Project_number = Value(SelectedSID)));

 

My goal is to add, with the + icon, a new empty line to the bottom gallery.  So I added the empty line with

     Collect(Mylines,{}); 

And I can actulaly add many empty lines to the collection, still, the gallery shows none of the new lines. How can I refresh it  with the added empty lines ? Refresh(datasource) don't work as the collection is not accepted as a datasource.

 

fishtank.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @fsim ,

Based on the issue that you mentined, I have made a test on my side, and don't have the issue that you mentioned. The blank/empty reocrd could be displayed well within my Gallery.

 

Please check if the empty/blank record has been added into your Mylines collection property, and make sure the Gallery is binded to the Mylines collection properly.

 

Please consider re-add a new Blank Gallery within your app, then bind it to your Mylines collection, then check if the blank record could be displayed within the Gallery.

 

Please also take a try to set the Height property of the Gallery (Gallery1) to following (this issue may be related to the Height of the Gallery, please resize the Height of the Gallery, then check if the issue is fixed😞

Sum(
ForAll(Gallery1.AllItems, Gallery1.TemplateHeight),
Value
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
RezaDorrani
Dual Super User II
Dual Super User II

Hi @fsim 

 

WHen you add the empty item to gallery, go to Tab - View - Collections and check to see if your collection has the empty row added to it

 

If the collection is connected to the gallery then irt should show the empty row item

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

v-xida-msft
Community Support
Community Support

Hi @fsim ,

Based on the issue that you mentined, I have made a test on my side, and don't have the issue that you mentioned. The blank/empty reocrd could be displayed well within my Gallery.

 

Please check if the empty/blank record has been added into your Mylines collection property, and make sure the Gallery is binded to the Mylines collection properly.

 

Please consider re-add a new Blank Gallery within your app, then bind it to your Mylines collection, then check if the blank record could be displayed within the Gallery.

 

Please also take a try to set the Height property of the Gallery (Gallery1) to following (this issue may be related to the Height of the Gallery, please resize the Height of the Gallery, then check if the issue is fixed😞

Sum(
ForAll(Gallery1.AllItems, Gallery1.TemplateHeight),
Value
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @RezaDorrani ,

I did check and the empty lines are in the collection.

The gallery is linked to collection as well. 😕

@v-xida-msft ,

the Height was the issue.

I couln't properly select the gallery in the Canvas.

 

thanks again !

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,124)