web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Toggle Control on a Ga...
Power Apps
Unanswered

Toggle Control on a Gallery fires "onCheck - event" when the Gallery is reloaded - CheckBox works fine! Is this a bug?

(0) ShareShare
ReportReport
Posted on by

I want to make "m:m selection pattern" between two records in a CDS data source in a Canvas App using two galleries.

 

When selecting a record in the first gallery, the second gallery is loaded with "all relevant records" and using a toggle, the m:m is either true (if an exiting m:m exists) or false (if no m:m exist). This works fine and I can now relate or unrelate by switching the toggle.

 

Sometime the number of rows in the second gallery is large, and I added a filter on the second gallery to make selection easier. I now find some inconsistencies when filtering. Most of the time it works, but sometimes if I filter so the first record is true, and after that I do a new filter so the first row is false, it will fire the onCheck event (and never the onUncheck???) and set it to true. Sometimes only for the first row, but sometimes for all rows. This is really weird. I tried using the exact same events/formulas on a CheckBox and it works flawlessly.

 

I have made a recording of the issue. In the app I have made a toggle, that disables/enables the toggle in the gallery, so first I show that I cant trigger the error with checkbox, but the error comes with the Toggle.

 

The formulas used on both CheckBox and Toggle are:

default: !IsBlank(LookUp(selectedOrgTeam.SecurityGroups, SecurityGroup = ThisItem.SecurityGroup, SecurityGroup))

onCheck: If(boolUseToggle, Relate(selectedOrgTeam.SecurityGroups, ThisItem);Set(selectedOrgTeam, selectedOrgTeam), false)

onUnCheck: Unrelate(selectedOrgTeam.SecurityGroups, ThisItem);Set(selectedOrgTeam, selectedOrgTeam)

 

I have tried to completely rewrite the logic, so all galleries are based on collections in stead of the CDS data source, and then do all the true/false logic in the collection, to have full control of "loading sequence", but the error is still occurring.

 

Any ideas what to do?

 

@HemantG thanks for pointing me to this forum, although this is not really a "pro dev" issue. 🙂

 

 

 

 

 

 

I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    the solution (two custom entities with m:m) and the canvas app. If anyone want to try to reproduce.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard