Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Multiple IF statement

(0) ShareShare
ReportReport
Posted on by 504

I have a dropdown list (DataCardValue16) Where if I choose "Other" a textbox will appear. If(DataCardValue16.Selected.Value="Other",true,false).

 

I am trying to make validation that the textbox is required, if user chose "Other" and did not input anything on the textbox the button will be DisplayMode.Disabled.

If(DataCardValue16.Selected.Value="Other" && DataCardValue18.Text="",DisplayMode.Disabled,DisplayMode.Edit)
The Code above  works

but I have another Set of dropdown, how to do it?

Categories:
  • mdevaney Profile Picture
    mdevaney 29,987 on at
    Re: Multiple IF statement

    @nagestiada 

    Changed it now.  Best of luck building your app!

  • nagestiada Profile Picture
    nagestiada 504 on at
    Re: Multiple IF statement

    this worked but should use || (or) instead of && (and). Thank you!

  • Verified answer
    mdevaney Profile Picture
    mdevaney 29,987 on at
    Re: Multiple IF statement

    @nagestiada 
    I made an error.  It should be this instead.

     

    If(
     DataCardValue16.Selected.Value="Other" && DataCardValue18.Text=""
     || DataCardValue17.Selected.Value="Other" && DataCardValue19.Text=""
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • mdevaney Profile Picture
    mdevaney 29,987 on at
    Re: Multiple IF statement

    @nagestiada 
    Can you please send a screenshot and supply the error message?

  • nagestiada Profile Picture
    nagestiada 504 on at
    Re: Multiple IF statement

    If(DataCardValue16.Selected.Value="Other" && DataCardValue18.Text="", DataCardValue21.Selected.Value="Yes" && DataCardValue19.Text="" ,DisplayMode.Disabled,DisplayMode.Edit)

     

    I'm getting invalid if statement error

  • nagestiada Profile Picture
    nagestiada 504 on at
    Re: Multiple IF statement

    If(DataCardValue16.Selected.Value="Other" && DataCardValue18.Text="" || DataCardValue21.Selected.Value="Other" && DataCardValue19.Text="" ,DisplayMode.Disabled,DisplayMode.Edit)

    Im trying this set of code but second statement does not work

  • mdevaney Profile Picture
    mdevaney 29,987 on at
    Re: Multiple IF statement

    @nagestiada 

    Just repeat the validation as a 2nd set of criteria in the FILTER.

    If(
     DataCardValue16.Selected.Value="Other" && DataCardValue18.Text="",
     DataCardValue17.Selected.Value="Other" && DataCardValue19.Text=""
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • eka24 Profile Picture
    eka24 20,921 on at
    Re: Multiple IF statement

    Try on the displaymode of the button:

    If(DataCardValue16.Selected.Value="Other", DisplayMode.Edit, DisplayMode.Disabled)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard