web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Referencing OptionSetV...
Power Apps
Answered

Referencing OptionSetValue Data Type Later in Form

(0) ShareShare
ReportReport
Posted on by 1,104

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?

 

Categories:
I have the same question (0)
  • rebeccas Profile Picture
    2,591 on at

    Is the:

    RequestTypeValue.Selected.Value="Initial Request"

    selected on a different screen or the same and the same form you are trying to set the display mode for a different form?

  • SeanHenderson Profile Picture
    1,104 on at

    @rebeccas 

    Same form, same screen.

  • rebeccas Profile Picture
    2,591 on at

    So basically they can get in the form as an Edit but if they select "Intial Request" from a combo box in that form then you want the form to be disabled at that point? That is what your If statement seems to be saying.

    Is that what you are wanting to do?

  • SeanHenderson Profile Picture
    1,104 on at

    Yes, there are two types of request Initial and Supplemental, which can be selected from the Request Type optionset box. Then, later in the form, they can enter the Initial Cost and Supplemental Cost. There will always be an initial cost, because even for supplmental types, there was an initial cost in the past. But if they Request Type selected is Initial Request then there will be no need for the Supplemental Cost data card on the form, so it should be disabled. The way I have my formula set up, it is checking the Request Type optionset for a string, which doesn't work.

  • rebeccas Profile Picture
    2,591 on at

    Okay...so you can't select something in the form and then disable the whole form or it won't save any of it (including that selection).

     

    What you can do is disabled certain cards in the form off that selection. So take the same If statement you have and put it on the display mode of the cards that you want to be disabled for that selection. That will give you the same result but work. You can just copy and paste it onto each of the cards you want disabled when they select Intial and it will just make those cards locked down basically. 

     

    Just a side note I would also suggest is that you also put on the type that the OnChange that if you select Initial it resets the ones you don't want them to change at that point. That way if they selected a different type and selected a bunch of data and then go back and change it to 'Initial' it resets all that data that should not have anything in there. 

     

    I hope I didn't just make it confusing. Let me know if I did and I will try and explain better.

  • SeanHenderson Profile Picture
    1,104 on at

    @rebeccas 

    Sorry if I wasn't clear, but this is for setting the DisplayMode on a particular card in the form, in particular the card for Supplemental Cost. I want that card to disable when Initial Cost is selected in the drop down located on the Request Type card.

    My formula is already set up on the supplemental cost data card.

    The problem is that the OptionSetValue data type from the Initial Request drop down is unsupported for evaluation. So how do I work around this?

  • rebeccas Profile Picture
    2,591 on at

    Okay...that makes more sense. 

     

    That should work...I use it all the time. Check on your combo box and make sure you have the "allow multiple selections" turned off. I want to say I had that be an issue for me before.

     

    Let me know if that isn't it and we can work through a few other issues it could be but it CAN work so probably just something little. 

  • SeanHenderson Profile Picture
    1,104 on at

    Multiple select is turned off, same issue.

  • SeanHenderson Profile Picture
    1,104 on at

    @rebeccas 

    The data is a field in a custom entity in Common Data Service.

  • rebeccas Profile Picture
    2,591 on at

    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. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard