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

Error: Incompatible types for comparison. These types can't be compared Record , Record

Hi All,

I have created a collection of my dataset which is a SharePoint list.

In my app, Gallery, I am trying to filter the collection with a combo control (choices of Phases) and a search text input by using the below formula : Search(Filter(colGridData,Phases = cmbfilterphases_1.Selected.Result),TextInput_search_project_2.Text,"Project_Name").

 

Here colgriddata is my collection of SharepointlIst and Phases is the choice field and TextInput_search_project_2 is my text input field to search the gallery for the project name.

However I am getting an error Incompatible types for comparison. These types can't be compared Record , Record.

Can you please assist.
 

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-dezhili-msft
Microsoft
Microsoft

Hi @Aminah_Hussain ,

Please try:

Search(Filter(colGridData,Phases.Value = cmbfilterphases_1.Selected.Result),TextInput_search_project_2.Text,"Project_Name")

Best Regards,

Dezhi

View solution in original post

@Aminah_Hussain ,

One (or more) of these four things is incorrect- 

  • Phases is a Single Select Choice field in colGridData
  • Project_Name is a Text field in colGridData
  • cmbfilterphases_1 is a Single Select Combo Box
  • TextInput_search_project_2 is a Text Input

If all were correct, the code would be valid.

View solution in original post

10 REPLIES 10
v-dezhili-msft
Microsoft
Microsoft

Hi @Aminah_Hussain ,

Please try:

Search(Filter(colGridData,Phases.Value = cmbfilterphases_1.Selected.Result),TextInput_search_project_2.Text,"Project_Name")

Best Regards,

Dezhi

WarrenBelz
Super User
Super User

@Aminah_Hussain ,

Happy to help on this - what type of fields are Project_Name and Phases. If Choice fields, are they single or multi-select and is cmbfilterphases_1 a single or multi-select?

Hi, 

Thanks for the above. However I am still getting an error Incompatible types of comparison. These types cannot be compared, Text, Record

HI Warren,

 

Project name is a Text input and Phases is a choice field with single select

 

Regards,

Aminah

Hi @Aminah_Hussain ,

Assuming cmbfilterphases_1 is also a single select combo box, your code would be

Search(
   Filter(
      colGridData,
      Phases.Value = cmbfilterphases_1.Selected.Result
   ),
   TextInput_search_project_2.Text,
   "Project_Name"
)

If this is not the case (as you indicated in the PM), one of the three assumptions is incorrect.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi Warren,

It gives the same error Incompatible types of comparison. These types cannot be compared, Text, Record.

Restating the properties of the controls: 

TextInput_search_project_2 - this is a search box to filter gallery based on the project name

Project Name column is a text input field

Phases is a choice col with single select.

My gallery is using the collection colgriddata which is picking data from the SharepointList:  Master_Project_List

Hope this information helps to resolve the query.

@Aminah_Hussain ,

One (or more) of these four things is incorrect- 

  • Phases is a Single Select Choice field in colGridData
  • Project_Name is a Text field in colGridData
  • cmbfilterphases_1 is a Single Select Combo Box
  • TextInput_search_project_2 is a Text Input

If all were correct, the code would be valid.

Hi Warren,

Thanks for the above guidance, as a work around,

I copied the control from my gallery for the phases to use it as filter and then the formula does not throw any error but the gallery is not getting filtered on the selections.

 

Thanks for your assistance.

Hi Dezhili,

I copied the control from my gallery for the phases to use it as filter and then the formula does not throw any error but the gallery is not getting filtered on the selections.

 

Regards,

Aminah

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,204)