cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Gallery with Toggle / Checkbox inside each item not working

I have done this before and I am trying to do it in a new app and it keeps breaking. I have a gallery that is displaying a collection. That collection called PartRoster that has in it a column that is called PartTrack for example. The toggle or checkbox is meant to be able to update that value in the collection. I have in OnUnCheck - Patch(PartRoster,ThisItem,{PartTrack:false}) and OnCheck - Patch(PartRoster,ThisItem,{PartTrack:true}). If I have either OnCheck or OnUnCheck active with those commands and the other with just false it works. If I populate both the control stops working. It is permanently true and if I attempt to toggle it just flips back.

 

Like I said I have done this in other programs and tested those today. I am missing something obvious but I can't figure out what? Thanks for any help.

5 REPLIES 5
Highlighted
Community Champion
Community Champion

Re: Gallery with Toggle / Checkbox inside each item not working

Hi @BrianHFASPS ,

You are not missing something - I recreated what you have done on a test list and got the same equally strange behavior. A control not linked to any data resetting itself after an event - quite bizarre. I got something working as below - quite clunky, but it seems to mostly do what you need - the label is the value in the table.

CheckBoolean.gif

 

 

 

 

 

 

 

The OnCheck is

Patch(
   PartRoster,
   ThisItem,
   {PartTrack:true}
);
Refresh(PartRoster);
UpdateContext({vCheck:true})

OnUncheck

Patch(
   PartRoster,
   ThisItem,
   {PartTrack:false}
);
Refresh(PartRoster);
UpdateContext({vCheck:true})

Default of the checkbox

If(
    ThisItem.IsSelected,
    vCheck
)

I also tried

If(
    ThisItem.IsSelected,
    vCheck,
    ThisItem.PartTrack
)

with different clunky results.
I am wondering whether it would not be easier to put a toggle on linked to the current value and simply patch this back.

 

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.

Highlighted
Post Patron
Post Patron

Re: Gallery with Toggle / Checkbox inside each item not working

Thanks for double checking. The one piece I forgot to mention in my original post is I have some places in my apps that it works fine? I have an older app that has this functionality in 3-4 places. 2 work for sure and 1 for sure doesn't. Then I have the new app I am building and it doesn't work there. I recorded a video of it to show it in action. It is 3 minutes long if you have a moment to check it out and see if you see something I am missing. I obviously did something different in one than the other but I can't figure out what?

PowerApps Toggle Issue Video

Highlighted
Post Patron
Post Patron

Re: Gallery with Toggle / Checkbox inside each item not working

I have made some progress. I determined two fixes. One, the Default must be set to collection column rather than true/false. That creates the wonky behavior with the checkboxes. Two, using the toggle like this just doesn't work. When I switched my new app to checkboxes it just works. If I try to use toggles it flickers and won't work. Maybe the toggle just can't work that way?

Highlighted
Community Champion
Community Champion

Re: Gallery with Toggle / Checkbox inside each item not working

Hi @BrianHFASPS ,

Yes - I just got an endless loop on the toggle. as well.

Highlighted
Post Patron
Post Patron

Re: Gallery with Toggle / Checkbox inside each item not working

I created a support ticket and they confirmed they are seeing the same behavior. The question now is if it is deemed "working as designed" or a bug. For now I have moved on with checkboxes so I can my app deployed and in use.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

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