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

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

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

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

Mattw112IG
Impactful Individual
Impactful Individual

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

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,111)