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

Community site session details

Session Id : hWBvCaXI65JsC456YSL8CE
Power Apps - Building Power Apps
Answered

Enable a button based on a combo box selection

Like (0) ShareShare
ReportReport
Posted on 13 Mar 2024 17:29:52 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?
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,670 Super User 2024 Season 1 on 13 Mar 2024 at 18:22:02
    Re: Enable a button based on a combo box selection

    @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 14 Mar 2024 at 08:26:52
    Re: Enable a button based on a combo box selection

    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

Responsible AI policies

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

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 629 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 397 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 232 Moderator

Last 30 days Overall leaderboard
Loading complete