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

Dataverse Choice Column Comparison

Hi,

 

I have a form where I want to make a field required if a dropdown contains a particular value. The values for this dropdown are taken from a choice column in the Dataverse called Calculation.

 

I thought I could just do:
If(DataCardValue4.Selected.Value = 100000002, true, false)

or:

If(DataCardValue4.Selected.Value = "Average by Week", true, false)

 

100000002 is the numeric value of the choice in the Dataverse. I get an error that says "Incompatible types for comparison: These types can't be compared: OptionSetValue(Calculation), Text

 

Does anyone know how to do this comparison? Bear in mind, I am not checking a value in the Dataverse table, just checking what value is currently selected in the dropdown on the data card for the form.

 

Thanks

 

Sean

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @SeanHenderson,

 

As per your previous chat,

 

Table Name : CTRs

Choice Column Name :optionTest

Choice Column Name : Average by Week

 

So you need to Try below

 

If(DataCardValue4.Selected.Value = 'otionTest(CTRs)'.Average By Week,true, false)

 

Please mark as Answer if it is helpful and provide Kudos

 

 

Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

Blog : https://microsoftcrmtechie.blogspot.com

 

View solution in original post

4 REPLIES 4
rampprakash
Community Champion
Community Champion

Hello @SeanHenderson,

 

You can try below code

 

If(DataCardValue4.Selected.Value = 100000002,'COLUMNNAME (TABLENAME)'.TABLEVALUE,true, false)


(Eg)
'Status (Booking Updates)'.Active

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

Hi @rampprakash 

 

I'm not sure what you mean by COLUMNNAME (TABLENAME)'.TABLEVALUE. 

 

For testing, in the Dataverse I have a table called CTRs and a choice column called optionTest.

 

This is on a new form, there is no value stored in the Dataverse to look up for the record. The condition needs to be entirely dependent on what is currently displayed in the Combo Box for the datacard.

 

Sean

Hello @SeanHenderson,

 

As per your previous chat,

 

Table Name : CTRs

Choice Column Name :optionTest

Choice Column Name : Average by Week

 

So you need to Try below

 

If(DataCardValue4.Selected.Value = 'otionTest(CTRs)'.Average By Week,true, false)

 

Please mark as Answer if it is helpful and provide Kudos

 

 

Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

Blog : https://microsoftcrmtechie.blogspot.com

 

View solution in original post

Thank you, that did it. I needed to reference the name of the choice not the name of the choice column.

 

Sean

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,609)