Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: multiple if conditions in one button

    @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
    Re: multiple if conditions in one button

    @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)
    )
    
    

     

  • hstep Profile Picture
    on at
    Re: multiple if conditions in one button

    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

  • DavidZoon Profile Picture
    738 Most Valuable Professional on at
    Re: multiple if conditions in one button

    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.

  • shoog Profile Picture
    2,164 on at
    Re: multiple if conditions in one button

    You should use && rather than &

    && is the and operator

    & is concatenation of texts

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,017 Most Valuable Professional

Leaderboard