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 with And doesnt wor...
Power Apps
Answered

IF with And doesnt work as excel

(1) ShareShare
ReportReport
Posted on by 26

Hello,

 

i ve got easy problem but dont know why is not working properly.

User must type any text in TextInput2 and add at least one attachment to enable "Save button".

With  function below, it only needs one argument not two as i wanted to and button show

 

If(
IsBlank(TextInput2)  && IsEmpty(DataCardValue14.Attachments) ;
DisplayMode.Disabled;
DisplayMode.Edit
)

 

Any ideas?

Categories:
I have the same question (0)
  • 365-Assist Profile Picture
    2,327 Moderator on at

    Don't use semicolons. Use commas. I believe your PowerFX should be:

    If(
    IsBlank(TextInput2) && IsEmpty(DataCardValue14.Attachments),
    DisplayMode.Disabled,
    DisplayMode.Edit
    )

    --------------------------------------------------
    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    Subscribe: https://www.youtube.com/channel/UCFpvUlpx84FuIPOdInGKMTw
    Twitter: https://twitter.com/assist_365

    Regards
    Darren Lutchner - 365 Assist

  • Verified answer
    mmollet Profile Picture
    3,187 on at

    So right now what you have is saying:

     

    If the textinput is blank AND if the attachments are blank then disable the control. What it sounds like you want is If the textinput is blank OR if the attachments are blank then disable the control. This is b/c you are requiring both.

     

    In terms of logic:

    the positive is TexInput2 AND Attachments

    which means the opposite (or contrapositive) would be:

    !Attachents OR !TextInput2

     

    Since you are using the contrapositive version this would be your formula:

    If(IsBlank(TextInput2) Or IsEmpty(DataCardValue14.Attachments), DisplayMode.Disabled, DisplayMode.Edit)

     

    Not sure if the ';' should be ',' or not as that is based on your location/syntax used there. Hope this helps!

  • Michal_Boro17 Profile Picture
    26 on at

    Thank u, now i understand the logic.

     

    "Not sure if the ';' should be ',' or not as that is based on your location/syntax used there. Hope this helps!" -> Exactly, in my location this is the proper syntax

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