cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dorinda
Impactful Individual
Impactful Individual

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

4 REPLIES 4
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
Impactful Individual
Impactful Individual

@Nogueira1306 Thank you that worked perfect

Dorinda
Impactful Individual
Impactful Individual

@Pstork1 thank you that helps a lot!!

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,770)