cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chris_young
Helper III
Helper III

Patch executing in IF Satement regardless of Logical Test

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. 
1 ACCEPTED SOLUTION

Accepted Solutions
chris_young
Helper III
Helper III

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

View solution in original post

1 REPLY 1
chris_young
Helper III
Helper III

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,178)