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 Press
Second Press
Solved! Go to Solution.
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:
2)click outside the nested gallery:
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,
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.
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:
2)click outside the nested gallery:
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,
Hi @WarrenBelz
Thanks for the response.
With both responses I was able to get a better understanding of why the issue was occurring
Thanks for the explanation. Gave me a better understanding of how it works
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
198 | |
100 | |
59 | |
59 | |
55 |
User | Count |
---|---|
258 | |
161 | |
90 | |
79 | |
70 |