cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
farhandsome
Helper IV
Helper IV

PowerApps Gallery ForAll Question

Hi all,

 

I had a question about gallery usage with the ForAll feature. I have an auto-created gallery that is populated by a different record. I associated this new gallery with a checkbox for each item. I want all the checkboxes to uncheck if the user clicks the "close" button. That way if the gallery is reopened, all the checkboxes are fresh. This is a little hard to describe, so attached below is a picture of what I mean:

 

PowerApps Checkbox Error.PNG

 

As you can see, I am trying to use the "ForAll" feature with the gallery on the OnSelect feature of the "close" button in order to reset the values of the checkboxes to false. However, this does nothing to the values and I am not getting an error returned from the code. Does anybody have any ideas on how I can achieve this?

 

Thanks,

Farhan

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @farhandsome ,

Could you please share a bit more about your scenario?

Do you want to reset the Checkboxes within your Gallery when you press the "Close" button?

 

Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Close" button to following:

UpdateContext({PkgQty: false});
Set(IsReset, false);Set(IsReset, true)

set the Reset property of the Checkbox within the Gallery to following:

IsReset

Please consider 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
Digital
Impactful Individual
Impactful Individual

You could try using a context variable in the Reset property of the checkbox e.g. varReset

 

Then on the Save button update the variable. This will trigger the default for the checkbox e.g. false or blank.

 

UpdateContext({varReset: true});
UpdateContext({varReset: false}),

v-xida-msft
Community Support
Community Support

Hi @farhandsome ,

Could you please share a bit more about your scenario?

Do you want to reset the Checkboxes within your Gallery when you press the "Close" button?

 

Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Close" button to following:

UpdateContext({PkgQty: false});
Set(IsReset, false);Set(IsReset, true)

set the Reset property of the Checkbox within the Gallery to following:

IsReset

Please consider 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

Fantastic, this worked like a charm. I think I realize my mistake in using For All. Yes you are correct in your thinking: I want to reset the boxes when I push the close button. 

 

This is just the first step for this project, I'm sure I will have many more questions as issues arise! But thank you for this.

Another question - is it possible to set the displaymode based on if atleast one of the checkboxes is selected? I'd like to add a "start" button as well, but I want it to be disabled until the user selects atleast one of the checkboxes.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,738)