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

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
Community Support
Community Support

Re: PowerApps Gallery ForAll Question

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 Resolver I
Resolver I

Re: PowerApps Gallery ForAll Question

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}),

Community Support
Community Support

Re: PowerApps Gallery ForAll Question

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

farhandsome Helper III
Helper III

Re: PowerApps Gallery ForAll Question

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.

farhandsome Helper III
Helper III

Re: PowerApps Gallery ForAll Question

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,232)