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 / Patch executing in IF ...
Power Apps
Answered

Patch executing in IF Satement regardless of Logical Test

(0) ShareShare
ReportReport
Posted on by 136
If(User().Email <> "email1" ||
User().Email <> "email2" &&
DataCardValue17_1.Selected.Value = "4 - Confirmed",
Patch(BIS_CUSTOMER, {ID:Gallery7.Selected.ID}, {Request_x0020_Status:{Value:"3 - Pending"}}));
 
This works for patching the field correctly but it does it in all true or false cases. I have removed all the other code so I can focus just on what I have above. 
 
I did some other testing and the If statement works fine when I remove the Patch and replace it with something else. If I replace the Patch with Navigate(Screen1) it will or won't navigate depending on the outcome of the Logical Test in the If statement. With the Patch statement it always executes regardless of the Logical Test results. 
Categories:
I have the same question (0)
  • Verified answer
    chris_young Profile Picture
    136 on at
    If(User().Email <> "email1" Or
    User().Email <> "email2" &&
    DataCardValue17_1.Selected.Value = "4 - Confirmed",
    Patch(BIS_CUSTOMER, {ID:Gallery7.Selected.ID}, {Request_x0020_Status:{Value:"3 - Pending"}}));
     
    I had to change the || to Or
     
    After that is was executring correctly

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard