cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Continued Contributor
Continued Contributor

Dynamics and Option Sets and Dropdowns incompatible types error

I am creating a canvas app with Dynamics 365.

 

One of the fields I am using is an option set in Dynamics.  Won, Lost, Wash, vetted Out.  This is a dropdown.

 

I want to set visibility of another field based on the selected value.  So in the visible property for the other field I have "If(DataCardValue2.Selected.Value = "Won", true, false)

 

But I am getting an incompatible type error?  I have tried a lot of different ways to write this out but always get this error.

 

What am I doing wrong?

 

Thanks,

Terry

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Dynamics and Option Sets and Dropdowns incompatible types error

Let's say the option set name is OptionSet1.

 

Try changing it to: 

If(DataCardValue2.Selected.Value = OptionSet1.Won, true, false)

 

The reason it doesn't work with "Won" is because "Won" is a text field. While it is the same text as the value in your dropdown, they are not the same records. The dropdown record is actually a record from the optionset, hence, OptionSet1.Won.

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com

 

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Dynamics and Option Sets and Dropdowns incompatible types error

Let's say the option set name is OptionSet1.

 

Try changing it to: 

If(DataCardValue2.Selected.Value = OptionSet1.Won, true, false)

 

The reason it doesn't work with "Won" is because "Won" is a text field. While it is the same text as the value in your dropdown, they are not the same records. The dropdown record is actually a record from the optionset, hence, OptionSet1.Won.

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com

 

View solution in original post

Highlighted
Continued Contributor
Continued Contributor

Re: Dynamics and Option Sets and Dropdowns incompatible types error

Thanks!  Worked.  Has it always been this way?  I haven't done a power app in a while but I dont remember having to do that before?

 

Thanks,

Terry

Highlighted
Super User
Super User

Re: Dynamics and Option Sets and Dropdowns incompatible types error

Glad I could help! I have a vague feeling that it wasn't like that before the CDS connector (Improve data source experience app setting) was updated to the current version.

Good luck with the rest of the app! Feel free to reach out in case of any questions!

Thanks!
Hardit Bhatia
https://thepoweraddict.com

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (8,305)