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 / If Statment using AND
Power Apps
Answered

If Statment using AND

(0) ShareShare
ReportReport
Posted on by 118

What is the syntax for using And  in an if statment?

Need a button disabled if 2 condition are met

if fld_Generic.Text - "ABC"  AND IsBlank(fld_Relation.Selected.Value)

Then disable the button (DisplayMode.Disabled).

Thanks in Advance

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    37,233 Super User 2026 Season 1 on at

    Hi @AlbertoSP 

    The syntax looks like this:

    If(And(fld_Generic.Text="ABC", IsBlank(fld_Relation.Selected.Value)), 
    DisplayMode.Disabled,
    DisplayMode.Edit
    )

    You can also use the && syntax like this:

    If(fld_Generic.Text="ABC" && IsBlank(fld_Relation.Selected.Value), 
    DisplayMode.Disabled,
    DisplayMode.Edit
    )

     

  • Milansinh Raj Profile Picture
    149 on at

    Hey there,

     

    So achieve this functionality you have to write if function in button's "DisplayMode" property.

    Please refer bewlow screenshot to get more idea on this:

     

    disable button.png

    Code as per your field and requirement: 

    if(fld_Generic.Text = "ABC" &&  IsBlank(fld_Relation.Selected.Value), DisplayMode.Disabled, DisplayMode.Edit)

     

    Please mark this as a solution if really helps you.

     

    Thanks,

    Milansinh Raj

    disable button.png
  • AlbertoSP Profile Picture
    118 on at

    Thank you.

    Although the second solution using &&, doidn't seem to work

  • Milansinh Raj Profile Picture
    149 on at

    May I know which connection you are using here ? Dynamics CRM connector or CDS connection ?

    Because I have created demo app screen to show solution and I am using Dynamics CRM Connector here.

    It is working fine for me.

    Let me know so I can get knowledge in which case it cant be work

    Smiley Happy

     

    Thank you

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 294 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 169

Last 30 days Overall leaderboard