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
Super User
Super User

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.

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
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 (2,877)