Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

sort and filter in a teams app

(0) ShareShare
ReportReport
Posted on by

This problem is specific for Powerapps for Teams.

 

I am having some trouble with filtering my gallery view, based on two input; a text search and a drop down menu.

This is the code I am using in the Items property of the gallery:

 

Sort(
 Filter(
 Prøvegjennomgang_lab, //my data source
 Lokalitet.Value = varProsjekt, //this is an attribute that is filtered before entering the screen with the gallery, it works just fine
 StartsWith(IntrasisID, 'Søk prøver'.Value), //this is the text search, works just fine
 IsBlank(PrøvetypeFilter.Selected) || Prøvetype.Value = PrøvetypeFilter.Selected // this is the problem, where Prøvetype is a Choice column, and the PrøvetypeFilter is a dropdown menu
 ),
 IntrasisID,
 SortOrder.Ascending
)

 

I keep getting the error "Incompatible types for comparison" in Prøvetype.Value = PrøvetypeFilter.Selected, but there is no option to add .Value to Selected, only SelectedItems, which also throws the same error.

 

Is there something I am missing completely? 

Categories:
  • Verified answer
    CU12090750-0 Profile Picture
    on at
    Re: sort and filter in a teams app

    So it turned out I had missed something completely. The choices in PrøvetypeFilter came from a collection. I had the Item property for the filter set to nameofcollection.Result rather than .Value. After changing it I could use .Selected.Value in my filter. 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard