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

Referencing OptionSetValue Data Type Later in Form

Hi,

I posted a question earlier, and someone helped me get more information, but their answer pointed me to a resource that I couldn't find the solution in.

The problem is that I want to reference a data card from my form that uses an OptionSetValue data type in order to choose DisplayMode:

If(RequestTypeValue.Selected.Value="Initial Request", DisplayMode.Disabled, DisplayMode.Edit)

But I get an error on the = operator that the values being compared in the formula aren't the same type. As I understand it, I am trying to compare a string to an optionset, which it won't allow.

Does anyone out there know how to reference an OptionSetValue data type later in a form?

 

16 REPLIES 16

And its a Combo box or something else?

 

Do a label outside your form and set it to show the selected value of that selection and change it and make sure it shows so we can see if that itself is what is not working correctly or being referred to correctly. Let me know what you end up using to make that lable show the correct selection. 

SeanHenderson
Impactful Individual
Impactful Individual

Yes the RequestTypeValue is a Combo Box with 2 selections of Initial Request or Supplemental

 

I created a label and set the text property to:

RequestTypeValue.Selected.Value

 

When I change the selector in the combo box it displays my selection in the label.

I'm sorry...I can't think of anything else that could be causing that not to work. I use that a lot because I prefer it over hiding cards. I just can't think of what your issue could be. 

 

I'll hollar back tomorrow if I think of anything else to try.

SeanHenderson
Impactful Individual
Impactful Individual

@rebeccas 

Here are the two fields that I created in CDS that I am trying to compare:

image.png

image.png

I don't ever use CDS so that may be different. I really can't say.

 

All of my apps are either SharePoint or SQL.

 

I would think the fundementals are the same because I know they are between SharePoint and SQL but I really can't say for certain. 

 

Since you did the label that pulls the value you may try to see if you can refer to it and say:

If(Label1.Text="Initial Entry", DisplayMode.Disabled, Edit)

 

But that shouldn't be necessary. I would try it just to see though.

View solution in original post

SeanHenderson
Impactful Individual
Impactful Individual

Wow, that actually worked. So I just added a label to reference instead and made that invisible. You are right though I shouldn't have to do that.

Okay, that is good it worked but I'm not certain why. 

 

The only think I can think of is that when you put it in the label and referred back to it you were forcing it into Text format. You may try going back to your original code that looked at the combo box and try forcing it into Text format by doing Text(Combo.Selected.Value)="Initial Entry" and see if that will take care of it without the label. 

 

I normally just use that trick to work through the problem but you don't want to really have to use a label for that...it will get confusing and just plain annoying. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, 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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,003)