web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter in a ListBox
Power Apps
Answered

Filter in a ListBox

(0) ShareShare
ReportReport
Posted on by 11

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.

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @XenYx -

     

    1. Assuming your data source is SharePoint, is the "Activities" field in the "Maintenance_Reports" table a LookUp data type to a field called "Title" in the Maintenance Activities table?
    2. Is Activities field a single-select Choice?
  • XenYx Profile Picture
    11 on at

    @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:

    TitleActivity
    Machine1Activity1
    Machine1Activity2
    Machine2Activity1
    Machine2Activity2


    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.

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @XenYx - is the ComboBox control also set to allow multiple selections?

  • XenYx Profile Picture
    11 on at

    @Amik 

    The ComboBox "Machine" in Maintenance_Reports is a single-select-choice.

  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @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
    )
  • XenYx Profile Picture
    11 on at

    @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.

     

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @XenYx - you seem to be asking a different question. A List Box control and an Edit Form control are totally separate controls.

  • XenYx Profile Picture
    11 on at

    @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.

     

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @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?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 372 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 303 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 238 Super User 2026 Season 1

Last 30 days Overall leaderboard