cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
diogosanto
Frequent Visitor

Unable to select anything other than the first item on a nested gallery

Hi,

 

I've recently built a PowerApps App that contains a Gallery with grouped dates and a nested Gallery with the items for that date. I was able to select any item in it and navigate to the detail screen (Through Select(Parent) on a arrow, and the OnSelect Property of the nested Gallery where I set a variable with the selected item and then navigate).


But now I'm only able to select the first item on any of the groupings. So say I have a group with the date 12th of May and there are 3 items on that group, I can only select the first one, the other two don't trigger any OnSelect method.

 

I tried setting a label that reads a variable with ThisItem.ID, and it only updates its value on the first item of any grouping.

 

Is this a recent problem? As this wasn't happening earlier this week.

6 REPLIES 6
diogosanto
Frequent Visitor

Update: Reconstructing the Galleries from scratch restored some function, but now I'm unable to select anything past the 6th item (a group with 16 items is only allowing me to select its 6 first).

 

 

What's the formula on the Gallery items

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

diogosanto
Frequent Visitor

Can't be too specific with the table columns, but the Main Gallery formula is a GroupBy(Sort(Filter(collection that constructed from a filter on a SharePointList; other relevant filters);DateColumn;Ascending);DateColumn;"GroupName"), and the Nested Gallery is a filter on the collection where the items have ThisItem.DateColumn.

 

This also serves as an update, as I was able to select any item in the gallery, but to do so I had to make the nested Gallery shorter where it now scrolls inside its height (If(expandCollapse && ThisItem.IsSelected;CountA(ThisItem."GroupName".ID)*50+5;0)) . This is not the ideal solution, due to groups with low item count being very short in size, and increasing that height from x*50+5 to x*NestedGallery.TemplateHeight makes items non selectable again (on higher counts).

 

I just found this post with I think the same issue:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Nested-Gallery-Unable-to-Select-some-Items/t...

 

The workaround is a bit complex though.

 

For the issue of not being able to select an item of a nested gallery in general, I just found a simple solution:

  1. Within the gallery template of the nested gallery, I have a few icons; a bin for removing and a pencil for editing. 
  2. At the OnSelect of those icons I set a context variable that holds the "ThisItem".

 

UpdateContext({varSelectedNestedItem: ThisItem});​

 

 

Now I can use that variable in formulas of functions.

 

Hopefully this helps.

 

 


@Power_Robert wrote:

I just found this post with I think the same issue:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Nested-Gallery-Unable-to-Select-some-Items/t...

 

The workaround is a bit complex though.

 

For the issue of not being able to select an item of a nested gallery in general, I just found a simple solution:

  1. Within the gallery template of the nested gallery, I have a few icons; a bin for removing and a pencil for editing. 
  2. At the OnSelect of those icons I set a context variable that holds the "ThisItem".

 

 

UpdateContext({varSelectedNestedItem: ThisItem});​

 

 

 

Now I can use that variable in formulas of functions.

 

Hopefully this helps.

 

 


Thanks for the link, will check it out.

Regarding the second part, adding an icon and setting its OnSelect to UpdateContext({varSelectedNestedItem: ThisItem.ID}); and a label with varSelectedNestedItem doesn't register anything on the OnSelect (the value stays the last value that read on the last successful OnSelect) of the items past the 6th.

Hmm... More people seem to have this issue:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Max-selection-in-nested-gallery-6/m-p/399519


Might have a look at it later and see if I can replicate it. I noticed that having a container inside a gallery breaks the Select(Parent) formula. But you will clearly see that with the squiggly red line.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (47,578)