cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gemmalouiseboe
Frequent Visitor

Filtering gallery using IF statement & List Column

Hi there,

 

I am currently trying to filter a gallery using an IF statement however I am getting the error message ‘incompatible types for comparison. These types can’t be compared: record, text.

 

The reason why I’m getting this message I believe is because after filtering the products by business area (as a dropdown list),  I am then trying to filter the gallery by ‘product status’ which would be done by the user clicking on one of the 3 status options (live, new and in process). The product status value in SharePoint is a list column and therefore cannot be compared to the text which the user clicks on.

The code I have so far is:

If(filter([sharepoint data source], startswith(businessarea,businessareadropdown.selected.value)&&productstatus=gallery3.selected.value))

 

how do I get around this?

 

Thank you! 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Gemmalouiseboe 

The If statement doesn't need to be there and should not be in your formula.

It should be as follows (assuming your productstatus column is a choice column in your list):

Filter(datasource, 
    StartsWith(businessarea, businessareadropdown.selected.value) &&
    productstatus.Value = gallery3.selected.Value
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@Gemmalouiseboe 

The If statement doesn't need to be there and should not be in your formula.

It should be as follows (assuming your productstatus column is a choice column in your list):

Filter(datasource, 
    StartsWith(businessarea, businessareadropdown.selected.value) &&
    productstatus.Value = gallery3.selected.Value
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Amazing! Thank you

Hi Randy,

 

Would I be able to add a search functionality to this also? Im assuming the formula would be:

 

Searchbar.text,”product name”

 

How I would add this to the previous code you suggested ?

 

thanks! 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,207)