cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dorinda
Super User
Super User

incompatible types for comparison, These types cant be compared: optionsetvalue, text

I am just getting into using the Dataverse and i have a table that has a choice column called expense type.

 

I want to have a field only show when the choice field is Travel-Day Trips,

 

I am using this code below which I thought would work,

If(DataCardValue4.Selected.Value = "Travel-Day Trips",true, false)

 but I am getting the error.

 

Dorinda_0-1638552476230.png

 

 Any suggestions on how to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
Nogueira1306
Super User
Super User

Try this:

If(Text(DataCardValue4.Selected.Value) = "Travel-Day Trips",true, false)

 

Nit sure if it will work, though..

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

View solution in original post

5 REPLIES 5
Nogueira1306
Super User
Super User

Try this:

If(Text(DataCardValue4.Selected.Value) = "Travel-Day Trips",true, false)

 

Nit sure if it will work, though..

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Last Post on Community

My website!

Pstork1
Dual Super User
Dual Super User

The problem is that the value of a choice column in Dataverse isn't actually the text that is displayed.  Option columns store their choices in a central location.  So you need to use a loopkup to get the value.  This article explains.

Power Apps Guide - Dataverse - How to filter Dataverse choice columns - Power Apps Guide - Blog



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Dorinda
Super User
Super User

@Nogueira1306 Thank you that worked perfect

@Pstork1 thank you that helps a lot!!

Screenshot (378).png

 How to solve this error?

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (4,085)