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 ?

1 ACCEPTED SOLUTION

Accepted Solutions

@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

23 REPLIES 23
Super User III
Super User III

@powerapps890 ,

You have two posts on this that are related - I have answered the other one here, so the below will work if you fix that one.

Filter(
   Regression,
   If(
      IsBlank(ComboBox1.Selected.Result) || 
	  ComboBox1.Selected.Result = "All",
      true,
      Function in ComboBox1.SelectedItems
   ) && 
   If(
      IsBlank(Filter.Text),
      true,
      Filter.Text in Country
   ) && 
   If(
      IsBlank(Search_.Text),
      true,
      Search_.Text in 'Focus Topic'
   ) &&
   TheRadio=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.

 

But that is another app. I still can't get this toggle to work. Is this not possible? It seems like everything I try is not working. I just want to hide the unchecked boxes when the toggle is hit. @WarrenBelz 

@powerapps890 ,

Sorry I did not notice the different field names, but the principle is the same.

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
   )&& YourToggleFieldName=true
)

If you Patch this field with the value from the toggle (as per the other post), it should automatically update the filter.
Can you please explain exactly what you are trying to do and what is not working?

 

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.

Capture.PNG

When the toggle in the top right hand corner is clicked I only want the gallery to filter so that only checked boxes are visible in the gallery. It doesn't work because i have a toggle called toggle1 and it's never called. If the toggle is switched on then I want the gallery to filter out the unchecked boxes @WarrenBelz 

OK @powerapps890 ,

It is good to explain things fully so there is not confusion. You need to do the following:-

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.

 

 

I am getting an error for everything I already have this in my default for the checkbox If(
!varChangeFlag,
If(
(ThisItem.Title in collPrevUserVoting.Title || ThisItem.Title in collSelOptions.selName),
true,
false
),
If(
ThisItem.Title in collSelOptions.selName,
true,
false
)
). I think that is why it won't take what you said should be the default @WarrenBelz 

@powerapps890 ,

What are you trying to achieve with this?

If(
   !varChangeFlag,
   If(
      (
         ThisItem.Title in collPrevUserVoting.Title || 
         ThisItem.Title in collSelOptions.selName
      ),
      true,
      false
   ),
   If(
      ThisItem.Title in collSelOptions.selName,
      true,
      false
   )
)

You have to plan your structure to achieve your needs. 

  • To get the filter to work, you need to filter the collection
  • To filter only the checked boxes, the value needs to be in a collection field (hence the added column).
  • To get this value in the record you need to Patch the collection field with the value of the check box whenever it is updated.
  • If you do not have the Default of the checkbox directly "bound" to the field you have just updated, when you select another checkbox, the first one will reset to the default you have set above.

The Filter still should actually work as the field in the collection has been patched, but it would be confusing for a user to see boxes being unchecked when the next one is checked. So you need to make a decision whether you want the functionality you have asked for (as per my post) and do something else to manage your current Default function.

 

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.

Hi @powerapps890 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

If(Toggle2_1.Value,
Sort(
Filter(
collCPQMasterData,
If(
IsBlank(ComboBox1_2.Selected.Result) || ComboBox1_2.Selected.Result = "All",
true,
'Functional Area' in ComboBox1_2.SelectedItems
) && If(
IsBlank(ComboBox1_3.Selected.Result) || ComboBox1_3.Selected.Result = "All",
true,
'Backlog Status' in ComboBox1_3.SelectedItems
) && If(
IsBlank(Filter_1.Text),
true,
Filter_1.Text in 'Requirement Source'
) && If(
IsBlank(Search__1.Text),
true,
Search__1.Text in Name
)
)
,CheckBoxColumn,Descending),
Filter(
collCPQMasterData,
If(
IsBlank(ComboBox1_2.Selected.Result) || ComboBox1_2.Selected.Result = "All",
true,
'Functional Area' in ComboBox1_2.SelectedItems
) && If(
IsBlank(ComboBox1_3.Selected.Result) || ComboBox1_3.Selected.Result = "All",
true,
'Backlog Status' in ComboBox1_3.SelectedItems
) && If(
IsBlank(Filter_1.Text),
true,
Filter_1.Text in 'Requirement Source'
) && If(
IsBlank(Search__1.Text),
true,
Search__1.Text in Name
)
)) - This is what i have in the items. 

Patch(collCPQMasterData,ThisItem,{CheckBoxColumn:true})

Patch(collCPQMasterData,ThisItem,{CheckBoxColumn:false}) - I have this in checked and unchecked. It works, but it does not work when the previous answers are loaded in. In my app it pulls the checkboxes the person submitted the last time. So it only filters the new checkboxes they select. @WarrenBelz 

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 (41,532)