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

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,195)