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 Or statement together
Power Apps
Answered

If Or statement together

(1) ShareShare
ReportReport
Posted on by 71

Hi all,

 

So i'm trying to use an "If" together with an "Or" to get two possible outcomes below as to whether a button result can be edit or disabled, which doesn't seem to work. An invalid number of arguments, received one but expected 2 or more.

 

If(Or

(DataCardValue5.Selected.Value <> Blank() && DataCardValue6.Selected.Value <> Blank(),
 DataCardValue5.Selected.Value <> Blank() && DataCardValue6.Selected.Value = "Longer (please give comment)" && DataCardValue25.Value <> "",
    DisplayMode.Edit,
    DisplayMode.Disabled))
 
Any help would be greatly appreciated.
Categories:
I have the same question (0)
  • ANB Profile Picture
    7,252 Super User 2026 Season 1 on at

    Hi @Steggsy17 Try this:

     

    If( 
     Or(
     And( 
     !IsBlank(DataCardValue5.Selected.Value) , 
     !IsBlank(DataCardValue6.Selected.Value)
     ),
     And(
     !IsBlank(DataCardValue5.Selected.Value) , 
     DataCardValue6.Selected.Value = "Longer (please give comment)" , 
     !IsBlank(DataCardValue25.Value)
     )
     ),
     DisplayMode.Edit,
     DisplayMode.Disabled
     )

     

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

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • Verified answer
    Michael E. Gernaey Profile Picture
    53,974 Moderator on at

    Hi @Steggsy17 

     

    The issue is you aren't closing your Or properly

    Yours
    
    If(Or
    (DataCardValue5.Selected.Value <> Blank() && DataCardValue6.Selected.Value <> Blank(),
     DataCardValue5.Selected.Value <> Blank() && DataCardValue6.Selected.Value = "Longer (please give comment)" && DataCardValue25.Value <> "",
     DisplayMode.Edit,
     DisplayMode.Disabled)
    )
    
    Mine
    If(Or
    (DataCardValue5.Selected.Value <> Blank() && DataCardValue6.Selected.Value <> Blank(),
     DataCardValue5.Selected.Value <> Blank() && DataCardValue6.Selected.Value = "Longer (please give comment)" && DataCardValue25.Value <> "") <== add ) here to close the Or,
     DisplayMode.Edit,
     DisplayMode.Disabled <== remove )
    )
    
    Clean 
    (DataCardValue5.Selected.Value <> Blank() && DataCardValue6.Selected.Value <> Blank(),
     DataCardValue5.Selected.Value <> Blank() && DataCardValue6.Selected.Value = "Longer (please give comment)" && DataCardValue25.Value <> ""),
     DisplayMode.Edit,
     DisplayMode.Disabled
    )


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • Michael E. Gernaey Profile Picture
    53,974 Moderator on at

    Hi @Steggsy17  if my post solved your issue if you can mark it as such please. using the Accept as solution

    Thanks

     

  • Steggsy17 Profile Picture
    71 on at

    thanks @FLMike I can't believe that was a missing bracket, been a long day

    Appreciate the quick response

     

    thanks also @ANB for another solution, which I will look at too as I've not used the IsBlank function yet

    Appreciate the quick response

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard