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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Enable a button based ...
Power Apps
Unanswered

Enable a button based on a combo box selection

(0) ShareShare
ReportReport
Posted on by 21

Hi all,

 

I'm a beginner on this and might be very simple. I need to enable/disable a button based on a selection from a combo box. This is what I'm writing:

 

If("Capex" in DataCardValue17_1.SelectedItems.Value,DisplayMode.Edit,DisplayMode.Disabled)
 
Maybe because my combo box is based on a column with Choices, I'm getting this message highlighted on "Capex" - Can't convert this data type. Power Apps can't convert this Text to an Optionsetvalue.
 
Any workaround?
Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @jda2005py - based on your description it sounds like you're data source is Dataverse.

     

    Assuming you want to enable the button if Capex is selected.

     

    For a Local Choice, apply the below to the DisplayMode property of your Button control:

     

    If(
     'Your Local Choice Field (Your Table Plural Name)'.Capex in DataCardValue5.SelectedItems,
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    For a Global Choice, use:

     

    If(
     'Your Global Choice Field'.Capex in DataCardValue5.SelectedItems,
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

     

    Notes:

     

    To identify the "Plural Name" for your table, open your table in Dataverse and select the properties window:

     

    Amik_0-1710353874104.png

     

    Another simpler option is to simply add an Edit Form control into your screen, add the DataCard for your Choice field into your Form. Then if you select the Items property of the automatically generated ComboBox inside the DataCard, you will see the syntax you need.

  • jda2005py Profile Picture
    21 on at

    Thank you very very much, it worked!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard