Hi,
I just recently got into world of PowerApps and I'm running into an issue. I tried to search for related messages in this form, but could not find something related.
What I'm tryin to accomplish
SharePoint
PowerApps
What I got so far
This is where I get stuck
Is there anyone who can help me out with this problem at hand?
Thanks!
Solved! Go to Solution.
Ah, had to re-read your original post that you have a choice column with a multi-select option turned on.
So, you need to compare all the choice options against all of the combobox options.
The formula would be:
Filter(Leveranciers;
Sum(ForAll(Categorie, If(Value in ComboBoxCategory.SelectedItems.Value, 1, 0)), Value)>0
)
This is one of several ways to go about this. Essentially what happens is we use a ForAll table function to iterate the Categorie values. A simple If statement will compare each iteration value to determine if it is in the selected combobox items. If so, then that row of the forall table will be 1. Finally, we sum all the Value columns of the ForAll (the value columns in this case are all the 1's and 0's just determined). If the sum is more than 0, then there was a match and the result will be true and thus that row included in your resultant filter.
Since Category is a Choices column, it will be a record. So, you need to reference the column of that record to compare.
Filter(Suppliers, Category.Valuye = ComboBoxCategory.Selected)
I hope this is helpful for you.
Hi @RandyHayes,
I tried your solution, but i did not work. With me the = gets red underlined. Stating: incompatible types for comparison.
Opps, I see there was a typo in my formula and a missing column name.
Should be:
Filter(Suppliers, Category.Value = ComboBoxCategory.Selected.Value)
@RandyHayes, updated the code, but still i get the same message: incompatible types for comparison, these types cannot be compared: table, text. (later past was different before)
When i adapt the formula to:
is still get an error stating:
Yes, you will get an error with that formula! Totally glossed over the multiple selections!
Filter(Leveranciers; Categorie.Value in ComboBoxCategory.SelectedItems.Value)
Is what you want.
Your SelectedItems is a table. When you put a column name behind it, it just makes it a table with just that column...but it's still a table. And you can't compare a text value to a table.
The in operator will resolve that.
Keep in mind that the in operator is not delegable, so if you have more than the record limit items in your datasource, this will be an issue.
Hi @RandyHayes,
Updated the formula with your suggestion, still getting an error, this time the first value gets underlined with the message:
PowerApps only allows me to select Value in the first case. So not sure what else there can be?
Ah, had to re-read your original post that you have a choice column with a multi-select option turned on.
So, you need to compare all the choice options against all of the combobox options.
The formula would be:
Filter(Leveranciers;
Sum(ForAll(Categorie, If(Value in ComboBoxCategory.SelectedItems.Value, 1, 0)), Value)>0
)
This is one of several ways to go about this. Essentially what happens is we use a ForAll table function to iterate the Categorie values. A simple If statement will compare each iteration value to determine if it is in the selected combobox items. If so, then that row of the forall table will be 1. Finally, we sum all the Value columns of the ForAll (the value columns in this case are all the 1's and 0's just determined). If the sum is more than 0, then there was a match and the result will be true and thus that row included in your resultant filter.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
191 | |
52 | |
41 | |
39 | |
35 |
User | Count |
---|---|
263 | |
86 | |
71 | |
69 | |
66 |