Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Unable to see all optionset value in power fx expression while editing command bar

(0) ShareShare
ReportReport
Posted on by 5

Hi 

I am facing an issue while editing command bar. I am trying to add a power FX expression on a button visibility formula. I want to pick an option set value and cehck what option is selected and based upon that will hide/show the button below is my expression

If(Self.Selected.Item.Status = 'Status (Notifications)'.Inactive && Self.Selected.Item.Notificationtype <> 'Notification Type'. Optionsetvalues , true, false)
The issue is that when I am trying the compare the Notification Type below 
Self.Selected.Item.Notificationtype <> 'Notification Type'. Optionsetvalues 
the expression is not showing all the Optionsetvalues  to add the condition, some options are not appearing in the expression
Please note Notification Type is a global option set and  Self.Selected.Item.Notificationtype  in the field using the global option set 
Also I am editing the model driven app only please let me know what am I missing how it can be fixed 
  • SajidSalim Profile Picture
    3 on at
    Unable to see all optionset value in power fx expression while editing command bar
    @Dru56's answer fixed my problem. It seems like the PowerFX editor within Model-Driven Apps is buggy. When opening via Component Library, which is just a Canvas App, everything seems to be working fine.
  • Suggested answer
    Shahryar Sultan Profile Picture
    on at
    RE: Unable to see all optionset value in power fx expression while editing command bar

    One thing to check is whether the global option set has any inactive options. Inactive options are not visible in the Power FX expression editor by default, so you may need to enable them to see all the options. To do this, follow these steps:

    1. Open the global option set definition in the Dynamics 365 solution.

    2. In the "Options" tab, click the "View" button in the ribbon.

    3. In the dropdown, select "Inactive options".

    4. Any inactive options will now be visible. Make a note of the exact spelling and capitalization of the option set values you want to use in your expression.

    Another thing to check is the syntax of your expression. It looks like you are using a dot notation to reference the option set values, but this is not the correct syntax for Power FX. Instead, you should use square brackets to reference the option set values. Here is the corrected expression:

    If(Self.Selected.Item.Status = 'Status (Notifications)'.Inactive && Self.Selected.Item.Notificationtype <> [Optionsetvalues], true, false)

    In this expression, the square brackets around "Optionsetvalues" indicate that it is a reference to the option set values in the global option set.

    Hopefully this helps you to fix the issue and set the visibility of your button based on the value of the global option set field.

  • Suggested answer
    Dru56 Profile Picture
    7 on at
    RE: Unable to see all optionset value in power fx expression while editing command bar

    We had the same problem today.  I edited the same formula in the "Component Library" by using the "Open component library" button and all my option set values were visible there.  After saving, the original command bar editor window works as expected again.

    pastedimage1676989987097v1.png

  • Suggested answer
    Abdul Wahab Profile Picture
    12,085 Moderator on at
    RE: Unable to see all optionset value in power fx expression while editing command bar

    Hi Sher M Khan Lodhi,

    I can see all the options. 

    pastedimage1676609858784v1.png

    It seems to refresh, cache, publish or have syntax (check above if this is the case) issues.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 671 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 167 Super User 2025 Season 1

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 138 Most Valuable Professional

Product updates

Dynamics 365 release plans