web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / If Or statement together
Power Apps
Unanswered

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,223 Super User 2025 Season 2 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,325 Super User 2025 Season 2 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,325 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard