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 / Combine two IF conditi...
Power Apps
Answered

Combine two IF conditions in one button in DisplayMode

(0) ShareShare
ReportReport
Posted on by 64

Hi, I really need your help on how can I combine these two conditions in PowerApps DisplayMode. I tried to combine these two (refer no 2 in the screenshot), and it returns no error but when I published my app, the button cannot be clicked and saved the data. Really appreciate your help

 

Condition 1: If(DataCardValue38.Text="Not Processed",DisplayMode.Disabled,DisplayMode.Edit)

 

Condition 2: If(And(IsBlank(Datefrom.SelectedDate) || IsBlank(DataCardValue34.SelectedItems.DisplayName) || IsBlank(DataCardValue35.SelectedItems.DisplayName)),Disabled)

 

 

Powerapps DisplayMode.PNG
Categories:
  • Verified answer
    RiccoHipp1903 Profile Picture
    284 on at

    I would try this 

    If(
     DataCardValue38.Text="Not Processed",
     DisplayMode.Disabled,
     If(And(IsBlank(Datefrom.SelectedDate) || IsBlank(DataCardValue34.SelectedItems.DisplayName) || IsBlank(DataCardValue35.SelectedItems.DisplayName)),
     Disabled,
     Edit)
    )
  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Nbz78,

    Do you want to disable the button when either of the condition is met or both of them are met?

     

    I think your issue is related to the validation of the DataCardValue34.SelectedItems and DataCardValue35.SelectedItems.

     

    Since SelectedItems is a Table value, you should use the IsEmpty() function instead of the IsBlank() function.

    If you want to disable the button once either of the condition is met:

    If(
     DataCardValue38.Text="Not Processed" ||
     (And(IsBlank(Datefrom.SelectedDate) || IsEmpty(DataCardValue34.SelectedItems.DisplayName) || IsEmpty(DataCardValue35.SelectedItems.DisplayName)),
     Disabled,
     Edit)
    )

    If you want to disable the button once both of the conditions are met:

    If(
     DataCardValue38.Text="Not Processed" &&
     (And(IsBlank(Datefrom.SelectedDate) || IsEmpty(DataCardValue34.SelectedItems.DisplayName) || IsEmpty(DataCardValue35.SelectedItems.DisplayName)),
     Disabled,
     Edit)
    )

     

  • Nbz78 Profile Picture
    64 on at

    Hi thank you for your help! 🙂 I tried your code and everything seems good. Will let you know if I encounter any issues on this

  • Nbz78 Profile Picture
    64 on at

    Thanks for helping!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard