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 / Disable button based o...
Power Apps
Answered

Disable button based on multiple condition

(0) ShareShare
ReportReport
Posted on by 227

Hi,

I have Radio button which contains "Y" and "N". When User Clicks "Y" it hides few datacards that are not needed. When User Clicks "N" it displays datacards that are need. The "N" part consist of 1 more radio button say Radio2, which also contains "Y" and "N". When User clicks "Y" it display one datacard let's say DataCard1, when "N" is selected, it display datacard2. Now, I would like to disable buttton if datacard1 or datacard2 is empty. As soon as user enter some data, the button should be enable otherwise it will be in disable mode.

 

I have below code in DisplayMode property of the button, which show button in disable mode when user selects "Y" in Radio2 and no data is entered in datacard1. I am not sure how should I disable the button when Radio2 has "N" selected and no data is entered in datacard2 ?

 

If(Radio1.SelectedText.Value="N" && IsBlank(DataCardValue1.Text),Disabled,Edit)

 

Any help is appreciated.

Thanks in advance for your time!

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Newbie12 

    If I understand right, you only want to be able to enable the button if there is data in either textinput box.  

     

    If(
     !IsBland(
     DataCardValue1.Text
     ) || !IsBlank(
     DataCardValue2.Text,Edit,Disabled
     )
    )

     

    If I have misunderstood and there are other conditions to be met before enabling the button, please let me know.

  • Newbie12 Profile Picture
    227 on at

    @Drrickryp 

    Correct. However, in the above code, when "Y" is selected from Radio1, button is disabled, Which is suppose to be enabled. So the only time when button shuld be disable is when datacard are empty.

     

    Any workaround ?

    Thanks in advance,

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Why do you want you want the button enabled if Y is selected, when the datacards aren't visible at that time and would be empty?  It seems to me the only time you want the button enabled is if there is data in one of the datacards.

  • Newbie12 Profile Picture
    227 on at

    Correct..."Y" has some dropdowns as well, that needs to be submitted. Sorry for confusion.

     

    Thanks,

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Newbie12 

    How about we try the logic the other way instead of when the button is disabled,  Figure out what the conditions must be met before the button can be enabled?  So far, I have data in either of two data cards.   

  • Newbie12 Profile Picture
    227 on at

    Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard