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

Notifications

Announcements

No record found.

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 
I have the same question (0)
  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    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.

  • Suggested answer
    Dru56 Profile Picture
    7 on at

    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
    Shahryar Sultan Profile Picture
    on at

    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.

  • SajidSalim Profile Picture
    3 on at
    @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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans