cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
CameronWilliams
Level: Powered On

Gallery Checkbox Issues

I've been working on this for a few days now, and I figured I would reach out for some help since I haven't been able to work through this on my own.

 

For context, I have a "selection" gallery that pulls a large set of data from a SharePoint list. As you can see in the screenshots, each gallery entry has a checkmark control that adds it to a collection called BannerScreens, which updates another "review" gallery to show the user what they have selected. The first gallery also has checkmark controls on each entry that update the permissions that the user needs to be granted. The second review gallery has a delete button next to each entry which allows the user to delete the entry from BannerScreens (and, thereby, remove the entry from the review gallery).

 

The OnSelect property for the delete button properly removes the item from BannerScreens, but it does NOT uncheck the entry in the selection gallery. When an item is removed from the review gallery, I want it to uncheck all of the checkmarks in the selection gallery's matching entry ONLY.

 

For contrast, I also have a Clear All button, which does properly remove all entries in the BannerScreens collection, as well as removes all checkmarks selected in the selection gallery. However, the delete button function should ONLY uncheck the four checkmarks in the matching selection.

 

Does anyone have any suggestions of solutions? Most support forums I've seen have claimed that checkboxes shouldn't be used with galleries as there is no simple way to toggle them, but checkboxes are more viable for my current application and userbase than comboboxes or dropdowns.

 

----

 

Unrelated, but I figured I would also mention some weirdness I've noticed with the search bar I've included in my app for the screens. I can select several screens that then get added to the BannerScreens collection (as apparent by the review gallery). But if I search for a screen and then cancel the search (or simply backspace my text entry), the checkmarks on the ones that I entered previously no longer display. This is a large data set (1600+ rows), so I've been assuming that this is a visual glitch. That being said, I can imagine it would be confusing to our end users. I want to, if possible, make it so the checkmarks they've selected will STAY selected, even if they search for something in the search textbox.

2 REPLIES 2
dynamicsedge
Level 8

Re: Gallery Checkbox Issues

@CameronWilliams 

 

This seems like a lot at play, a complex question.

 

We'll try to start with some simple high level approaches

 

  1. So many updates can be daunting and step on each other. You may want to have one or more Timer controls that stop any further changes to checkboxes, executes the current changes, then re-opens the ability to make further selections.
  2. For the search, you may want to have a Timer control that waits until typing has stopped or something like that and/or processes the stuff more in batch and less frequently. This is sort of complex and difficult to walk you through, so we'll give just this line item and leave the rest to your imagination  for now.

We think there's too much stuff going on at once and the logic may be stepping on itself. In other words, maybe an update is being done in the middle of another update, which could be causing even more problems than the ones you have stated here.

CameronWilliams
Level: Powered On

Re: Gallery Checkbox Issues

@dynamicsedge 

 

I haven't worked with timer controls yet, so I wouldn't know how best to implement them in order to reset the checkmarks in the matching entry in the selection gallery by clicking the Delete button in the review gallery. For reference, the following is the OnSelect code for the Delete button:

UpdateContext({
ViewChecked:false, 
UpdateChecked:false, 
RevokeChecked:false});

RemoveIf(BannerScreens,
ScreenName = ThisItem.ScreenName);

Currently, the button simply resets the variables which control what permissions are added to the entry, as well as removes the entry from the BannerScreens collection. For contrast, here is the code for the Clear All button:

UpdateContext({
ViewChecked:false, 
UpdateChecked:false, 
RevokeChecked:false});

RemoveIf(BannerScreens,true);

UpdateContext({DeleteEverything:true});
UpdateContext({DeleteEverything:false});

Like the Delete button, it disables the permission variables, but it also removes all entries in the BannerScreens collection, rather than an individual. It also triggers the update of the DeleteEverything context variable, which is the Reset condition for all four checkboxes in the selection gallery. 

 

This is fine for the clear all button, as it removes all checkboxes in the selection gallery, rather than just entry-specific ones. But the delete button should only delete the checkboxes on matching entries.

 

All of this being said, I did come up with a potential solution while away from the keyboard last night; however, I'm not entirely sure how well/efficiently it could be implemented since, as stated previously, I haven't utilized timer controls yet. Potentially, I could set a timer to start when an entry in the BannerScreens collection is updated with at least one permission (required), and then filter the selection gallery to remove the matching entry. Then, if deleted from the collection, it could reset that filter to show it in the selection gallery again. Currently, this is the Items property for the selection gallery, where "Screens" is the SharePoint list:

Filter('Screens',txtSearch_1.Text in SCREENNAME)

 

What are your thoughts? Do you know of a better means of implementing this?

Helpful resources

Announcements
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

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