Dear PowerApps Community,
I'm pretty new to powerApps and I'm stuck with the following case: I want to filter the entries in a ListBox depending on a previous selection in another field. I structured the Items property of the ListBox as follows:
Filter(Choices([@Maintenance_Reports].Activities), [@Maintenance_Activities].Title = DataCardValue8.Selected.Value)
The error is: Some types are incompatible for comparison. These types cannot be compared: Table, Text.
Can I somehow match the types in the property?
I'm grateful for any help.
@XenYx - this is not a misunderstanding. You were given a satisfactory answer to your question, and now you are asking a brand new and completely different question. This question should have been raised as a separate post.
Suppose someone in the Community wants to know how to submit an Edit Form control with a List Box control embedded inside it. How are they going to find the solution if the title of this post is "Filter in a ListBox?"
Please be mindful of this in future and please accept the solution to your question.
Regarding the new question, what is the data type of the field you want to update in the "Maintenance_Reports" list?
@Amik
Sorry for the misunderstanding. Yes, the ListBox/ComboBox is on an EditForm or I would like to use it to create a new entry.
@XenYx - you seem to be asking a different question. A List Box control and an Edit Form control are totally separate controls.
@Amik
Thanks, the filtering in the form works perfectly. However, the selected values are then not saved in the Maintenance_Reports list. The update value in the DataCard is: ListBox1.SelectedItems.
@XenYx - it's possible I am over-simplifying things here, but is this all you're trying to do?
Filter(
Maintenance_Activities,
Len(DataCardValue8.Selected.Value) = 0 || Title = DataCardValue8.Selected.Value
)
@Amik
The ComboBox "Machine" in Maintenance_Reports is a single-select-choice.
@Amik
Yes, my data source is Sharepoint. The ListBox Activities in Maintenance_Reports table is is a multi-select Choice and LookUp data type on a field Activity in the Maintenance_Activities table. The field Activity in the table Maintenance_Activities is a normal Text field.
The Maintanance_Activities list is structured as follows:
Title | Activity |
Machine1 | Activity1 |
Machine1 | Activity2 |
Machine2 | Activity1 |
Machine2 | Activity2 |
If I now select a machine in Maintenance_Reports, I only want to see the entries from Maintenance_Activities that are assigned to this machine.
@XenYx -