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 / multiple if conditions...
Power Apps
Unanswered

multiple if conditions in one button

(0) ShareShare
ReportReport
Posted on by

hi team, 

none of the solutions seem to work for me - im trying to get around the lack of the required fields when using patch , i have 2 if statements for one button which ive had to make 2 buttons for because i cant get it right. 

DataCardValue156.Selected.Value - this will either have vendor or self - written in it and depending on whats picked different fields populate 

 

If(DataCardValue156.Selected.Value = "Vendor" & IsBlank(DataCardValue206.SelectedDate)||IsBlank(DataCardValue227.Text)||IsEmpty(DataCardValue228.Attachments),DisplayMode.Disabled,DisplayMode.Edit)

OR

If(DataCardValue156.Selected.Value = "Self" & IsBlank(DataCardValue156.Selected.Value)||IsBlank(DataCardValue155.Selected),DisplayMode.Disabled,DisplayMode.Edit)

 

i want the display mode to be disabled until the required boxes have values in which has different boxes depending on the selection .

im sure im missing something simple

Categories:
I have the same question (0)
  • shoog Profile Picture
    2,164 on at

    You should use && rather than &

    && is the and operator

    & is concatenation of texts

  • DavidZoon Profile Picture
    738 Most Valuable Professional on at

    Hello,
    To simplify everything, it might be more appropriate to use the "Required" and ".Valid" parameters of your form:

     

    In the Datacards that are required, put "True" in the "Required" parameter, or in some cases, make this condition dynamic, example:

    DataCardValue156.Selected.Value = "Vendor"

     

    In the DisplayMode of the Button, put:

    If(Form1.Valid, DisplayMode.Edit, DisplayMode.Disabled)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily.

  • hstep Profile Picture
    on at

    Thanks , i cant because im using the patch function so that wont allow the required field to work . which makes it more complicated - ive made a workable solution using 2 buttons and an if parameter in the visible field but for updates later one its much better just having one

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @hstep 

    As the DisplayMode property 

    With({condition1:DataCardValue156.Selected.Value = "Vendor" && 
     IsBlank(DataCardValue206.SelectedDate)||
     IsBlank(DataCardValue227.Text)||
     IsEmpty(DataCardValue228.Attachments),
     condition2:DataCardValue156.Selected.Value = "Self" && 
     IsBlank(DataCardValue156.Selected.Value)||
     IsBlank(DataCardValue155.Selected
     },
     If(condition1 || condition2, DisplayMode.Disabled, DisplayMode.Edit)
    )
    
    

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @hstep 

    As the DisplayMode property 

    With({condition1:DataCardValue156.Selected.Value = "Vendor" && 
     IsBlank(DataCardValue206.SelectedDate)||
     IsBlank(DataCardValue227.Text)||
     IsEmpty(DataCardValue228.Attachments),
     condition2:DataCardValue156.Selected.Value = "Self" && 
     IsBlank(DataCardValue156.Selected.Value)||
     IsBlank(DataCardValue155.Selected
     },
     If(condition1 || condition2, DisplayMode.Disabled, DisplayMode.Edit)
    )
    
    

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard