cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

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 II
Super User II

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 II
Super User II

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
Post Prodigy
Post Prodigy

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 II
Super User II

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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