cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gareth1
Resolver IV
Resolver IV

Nested gallery item not maintaining fill

I'm working with a nested gallery inside another gallery with a list of questions and a label for the response and I'm having some trouble with setting the fill of the selected item

 

If I use the following on the Label I sometimes have to click twice before it recognises that the item is selected

 

If(ThisItem.IsSelected, btnStyle.DisabledFill, btnStyle.Fill)

 

 

I think this is related to the OnSelect function of the nested gallery item where I am patching the collection used by the parent gallery based on the response selected

 

Patch(
    CollectQuestions,
    LookUp(
        CollectQuestions,
        ID = checklistQuestionList.Selected.ID
    ),
    {Response: ThisItem.Response}
);

 

I can see that the value is updating but the fill value doesn't update it until it is selected the second time

 

I'm relatively new to PowerApps but would appreciate any help or pointing in the right direction

 

ThanksFirst PressFirst PressSecond PressSecond Press

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Gareth1 ,

I agree with @WarrenBelz .

Your settings about your gallery has no problem.

The key point should be the selecting position.

If you want to select one item of the nested gallery, you should click inside the nested gallery.

If you click outside the nested gallery, inside the outside gallery, it will not reflect one selected item in nested gallery.

1)click inside the nested gallery:

615.gif

 

2)click outside the nested gallery:

6151.gif

 

 

What's more, if you think your data does not fresh immediately after you update data source, you could add a refresh function after the patch function.

Please notice that fresh function only works for data source, not work for collection.

Just like this:

Patch(
    CollectQuestions,
    LookUp(
        CollectQuestions,
        ID = checklistQuestionList.Selected.ID
    ),
    {Response: ThisItem.Response}
);
Refresh(CollectQuestions)

 

 

Best regards,

Community Support Team _ Phoebe Liu
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
WarrenBelz
Super User
Super User

Hi @Gareth1 ,

The  setting you have Is the only one that will set the TemplateFill of any gallery selected item, primary or nested. What I believe is happening is that the first click is selecting the primary gallery, then the next one the nested item. There is nothing else you can set on this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

v-yutliu-msft
Community Support
Community Support

Hi @Gareth1 ,

I agree with @WarrenBelz .

Your settings about your gallery has no problem.

The key point should be the selecting position.

If you want to select one item of the nested gallery, you should click inside the nested gallery.

If you click outside the nested gallery, inside the outside gallery, it will not reflect one selected item in nested gallery.

1)click inside the nested gallery:

615.gif

 

2)click outside the nested gallery:

6151.gif

 

 

What's more, if you think your data does not fresh immediately after you update data source, you could add a refresh function after the patch function.

Please notice that fresh function only works for data source, not work for collection.

Just like this:

Patch(
    CollectQuestions,
    LookUp(
        CollectQuestions,
        ID = checklistQuestionList.Selected.ID
    ),
    {Response: ThisItem.Response}
);
Refresh(CollectQuestions)

 

 

Best regards,

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

Hi @WarrenBelz 

Thanks for the response. 

With both responses I was able to get a better understanding of why the issue was occurring

Hi @v-yutliu-msft 

Thanks for the explanation. Gave me a better understanding of how it works

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,307)