Hi,
I'm new to PowerApps and need to be able to change the parameter of the filter(Gallery) by pressing a button that changes the collection in a ComboBox.
I have so far created the buttons which changes the var "varFilter": First button changes it to colUnit - (a collection of choices() from a multiple choice collumn called 'Business Unit1') - the second button changes 'varFilter' to colServiceT - (a collection of choices() from a choice collumn) - I use Set(varFilter;colXXX) in the OnSelect of the buttons.
In Items of the gallery I use this code to filter:
Filter(
Services_1;
(ID in Ungroup(
ForAll(
ComboBox3_2.SelectedItems;
Filter(
Services_1;
If(varFilter=colUnit; Value in 'Business Unit1'.Value;varFilter=colServiceT; Value in 'Service Type'.Value
))
);
"Value"
).ID || IsBlank(ComboBox3_2.SelectedItems.Value)))
The Highligted code is where it gives me delegation error, but the list is not gonna be bigger than 400 rows so I dont think that will matter. I think I need help with how to reference to the value in varFilter in the if() statement, but tbh not too sure why it does not work. 🙃
English is not my first language so please ask if there is something I have to explain better. 😁
You may need to change a code a bit different. And "In" is not delegable but it will be fine since your total count less than the limit.
Filter(Services_1;
IsBlank(ComboBox3_2.SelectedItems.Value) ||
(ID in Ungroup(
ForAll(ComboBox3_2.SelectedItems;
Filter(Services_1;
If(varFilter=colUnit; Value in 'Business Unit1'.Value;varFilter=colServiceT; Value in 'Service Type'.Value
))
);
"Value"
).ID ))
Please provide more information to assist more.
Thanks,
Stalin - Learn To Illuminate
1. The data source is a Sharepoint list.
2. The Items property of the ComboBox is simply varFilter (which works when clicking the buttons)
We need to set variables to know which button clicked along with the Varfilter. So set the Business Unit button 1 OnSelect property to
Set(varFilter;colUnit);; Set(varFilterUnit; true)
Set Service Type button Onselect property to
Set(varFilter;colService);; Set(varFilterUnit; false)
Items property of the gallery to
Filter(Services_1;
IsBlank(ComboBox3_2.SelectedItems.Value) ||
(ID in Ungroup(
ForAll(ComboBox3_2.SelectedItems;
Filter(Services_1;
If(varFilterUnit; Value in 'Business Unit1'.Value;Value in 'Service Type'.Value
))
);
"Value"
).ID ))
If this does not work then please the collection sample. So that I can reproduce and provide the answer.
Thanks,
Stalin - Learn To Illuminate
Please let us know if anything needs on your post. We can help with this.
Please mark the post as Solved If I have answered your question.
Please give it a Thumbs Up if you find the suggestion helpful
Thanks,
Stalin - Learn To Illuminate
User | Count |
---|---|
257 | |
106 | |
87 | |
51 | |
43 |