I've got a gallery that shows results from a a datasource, I've got a toggle on the page that when clicked it filters the data to a certain paramater.
However, I also have a combo box the further filters the data when items are selected from it. What I would like to achieve is that when the toggle is selected the combo box filters also are applied when clicked. The code that I currently have is below, I believe this is possible, but simply can not figure out how.
Anyone have any ideas?
If( Toggle1.Value = true, Filter( DAB, <= Data Source Current_Category = "D" && Fiscal = "FY19/20" <= Column/Field ), If( IsEmpty(ComboBox4.SelectedItems.'Level 1 Function'), Filter( DAB, Fiscal = "FY19/20" ), Filter( DAB, 'Level 1 Function (AP19/20)' in ComboBox4.SelectedItems.'Level 1 Function' ) ) )
Solved! Go to Solution.
Hi @southafrican,
Try changing your code in:
If( Toggle1.Value, Filter( DAB, Current_Category = "D" && Fiscal = "FY19/20", If( IsEmpty(ComboBox4.SelectedItems.'Level 1 Function'), Fiscal = "FY19/20", 'Level 1 Function (AP19/20)' in ComboBox4.SelectedItems.'Level 1 Function' ) ), If( IsEmpty(ComboBox4.SelectedItems.'Level 1 Function'), Filter( DAB, Fiscal = "FY19/20" ), Filter( DAB, 'Level 1 Function (AP19/20)' in ComboBox4.SelectedItems.'Level 1 Function' ) ) )
Hope this solves your problem! 🙂
Basically, when I click the toggle the selected items in the combo box is no longer filtering the gallery.
for the gallery if you just use the following -
Filter( DAB, 'Level 1 Function (AP19/20)' in ComboBox4.SelectedItems.'Level 1 Function' )
does it filter?
Hi @southafrican,
Try changing your code in:
If( Toggle1.Value, Filter( DAB, Current_Category = "D" && Fiscal = "FY19/20", If( IsEmpty(ComboBox4.SelectedItems.'Level 1 Function'), Fiscal = "FY19/20", 'Level 1 Function (AP19/20)' in ComboBox4.SelectedItems.'Level 1 Function' ) ), If( IsEmpty(ComboBox4.SelectedItems.'Level 1 Function'), Filter( DAB, Fiscal = "FY19/20" ), Filter( DAB, 'Level 1 Function (AP19/20)' in ComboBox4.SelectedItems.'Level 1 Function' ) ) )
Hope this solves your problem! 🙂
Hi @southafrican,
I tested the code in my previous post again and found out that it still didn't do the trick... This one should be better:
If( Toggle1.Value, Filter( DAB, If( IsEmpty(ComboBox4.SelectedItems.'Level 1 Function'),
Current_Category = "D" && Fiscal = "FY19/20", Current_Category = "D" && Fiscal = "FY19/20" && 'Level 1 Function (AP19/20)' in ComboBox4.SelectedItems.'Level 1 Function' ) ), If( !IsEmpty(ComboBox4.SelectedItems.'Level 1 Function'), Filter( DAB, 'Level 1 Function (AP19/20)' in ComboBox4.SelectedItems.'Level 1 Function' )/*,
DAB*/ ) )
The last /*,DAB*/ is optional if you want to show all items in the Gallery when the Toggle is off and no items are selected in the ComboBox. Make sure you remove the Comment Block parts /* and */. If you don't want to use that you can just leave it out or leave it with the Comment Block parts intact for later optional use.
Let me know if this does the trick for you.
Thank you, this solved the problem.
User | Count |
---|---|
134 | |
129 | |
98 | |
75 | |
74 |
User | Count |
---|---|
206 | |
195 | |
69 | |
60 | |
52 |