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

Community site session details

Session Id : VYmwqX8x5+JEEKzt6jyyS1
Power Apps - Building Power Apps
Answered

Filter in a ListBox

Like (0) ShareShare
ReportReport
Posted on 9 Apr 2024 10:00:47 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.

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 10 Apr 2024 at 11:39:20
    Re: Filter in a ListBox

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

  • XenYx Profile Picture
    11 on 10 Apr 2024 at 11:18:33
    Re: Filter in a ListBox

    @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,665 Super User 2024 Season 1 on 10 Apr 2024 at 10:48:27
    Re: Filter in a ListBox

    @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 10 Apr 2024 at 10:26:05
    Re: Filter in a ListBox

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

     

  • Verified answer
    Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 09 Apr 2024 at 22:32:29
    Re: Filter in a ListBox

    @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 09 Apr 2024 at 12:01:40
    Re: Filter in a ListBox

    @Amik 

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

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 09 Apr 2024 at 11:50:14
    Re: Filter in a ListBox

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

  • XenYx Profile Picture
    11 on 09 Apr 2024 at 11:28:37
    Re: Filter in a ListBox

    @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,665 Super User 2024 Season 1 on 09 Apr 2024 at 10:48:26
    Re: Filter in a ListBox

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

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete