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

Hide unchecked boxes on toggle

I want to be able to hit a toggle button and it only shows the checkboxes that are selected. This is my items for the gallery Filter(
collCCBMasterData,
If(
IsBlank(ComboBox1.Selected.Result) || ComboBox1.Selected.Result = "All",
true,
'Functional Area' in ComboBox1.SelectedItems
) && If(
IsBlank(ComboBox1_1.Selected.Result) || ComboBox1_1.Selected.Result = "All",
true,
'Backlog Status' in ComboBox1_1.SelectedItems
) && If(
IsBlank(Filter.Text),
true,
Filter.Text in 'Requirement Source'
) && If(
IsBlank(Search_.Text),
true,
Search_.Text in Name
)
). How can I add a toggle to filter the data so only that only checked boxes are shown ?

23 REPLIES 23

@powerapps890 ,

Did you read the four points I raised and have you decided which path you need?

That is how the value is stored for the next time someone votes. I also have this in checked and unchecked. Collect(
collSelOptionss,
{selNamee:ThisItem.Title}
);
UpdateContext({varChangeFlagg:true}); Patch(collCPQMasterData,ThisItem,{CheckBoxColumn:true})

Collect(
collSelOptionss,
{selNamee:ThisItem.Title}
);
UpdateContext({varChangeFlagg:true}); Patch(collCPQMasterData,ThisItem,{CheckBoxColumn:true}) So how do I change the default to make this work? @WarrenBelz 

@powerapps890 ,

It is the Default of the checkbox that is the issue. It needs to reflect what you have patched, so it does not reset.

so i need to add the patch to here If(
!varChangeFlagg,
If(
(ThisItem.Title in collPrevUserVotingg.Title || ThisItem.Title in collSelOptionss.selNamee),
true,
false
),
If(
ThisItem.Title in collSelOptionss.selNamee,
true,
false
)
@WarrenBelz  How can i reflect what is patched?

@powerapps890 ,

I not sure of any different way of explaining the issue: -

  • You want the boxes to stay checked after another one is checked.
  • You can only do this by "binding" them to a value that is true/false only for the particular item with the same value as the checkbox.
  • My suggestion is an added field in the collection and patching to it with the value of the checkbox.
  • If you can think of another piece of logic that happens after you patch an item that always reflects the true/false of the box, then you can use this, but I cannot see one in the code you have posted.
  • The subject of this post and your question are answered with this - you cannot have the current Default and achieve the required outcomes, so you need to make a design decision.

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.

 

My boxes do stay checked when another one is checked. I do have them binded in the default. My problem is i the toggle wont work when the app is opened again. @WarrenBelz . 

What design decision can I make? I'm not understanding how to implement this. I will change whatever I need to to make this work. @WarrenBelz 

@powerapps890 ,

You cannot have your current Default on the checkbox. I gave you a solution about 12 posts previous to this (the one after you posted the screenshot). Can you please focus on this is you want to keep the boxes checked (and then display them). I have posted it again below.

 

Put a field in your collection for the checkbox to update

AddColumns(
   collCCBMasterData,
   "Checked",
   false
)

on the Default of your checkbox

ThisItem.Checked

On both the OnCheck and OnUncheck of the Checkbox

Patch(
   collCCBMasterData,
   ThisItem,
   Self.Value
)

then your filter

Filter(
   collCCBMasterData,
   If(
      IsBlank(ComboBox1.Selected.Result) || 
	  ComboBox1.Selected.Result = "All",
      true,
      'Functional Area' in ComboBox1.SelectedItems
   ) && 
   If(
      IsBlank(ComboBox1_1.Selected.Result) || 
	  ComboBox1_1.Selected.Result = "All",
      true,
      'Backlog Status' in ComboBox1_1.SelectedItems
   ) && 
   If(
      IsBlank(Filter.Text),
      true,
      Filter.Text in 'Requirement Source'
   ) && 
   If(
      IsBlank(Search_.Text),
      true,
      Search_.Text in Name
   )&& 
   If(
      Toggle1.Value=false,
      true,
      Checked=true
   )
)

 

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.

 

View solution in original post

@powerapps890 ,

I have had another look at your Default - I cannot guarantee this will work as I have no vision of your logic, but do everything in the post below and make the Default

(
   !varChangeFlag && 
   (
      ThisItem.Title in collPrevUserVoting.Title || 
      ThisItem.Title in collSelOptions.selName
   )
)
||
ThisItem.Title in collSelOptions.selName ||
ThisItem.Checked=true

Please understand this is outside the question you asked, for which a solution has already been provided.

 

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.

Is there a way I can filter the data then so that the checked boxes are always at the top @WarrenBelz  I tried what you posted and it didn't work.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (20,625)