cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

validate patch

condition a patch

The idea is to let the patch be made if the status column of the registration list that I will update is = "Not registered" if this condition is not met, simply throw a:

 

Notify ("The employee has already registered", Warning)

The patch formula works well and is as follows:

Patch (employee, First (Filter (Employees, Code = brsScanner.Value)), {Status: "Registered"})


the above formula indicates which record to update when the content of a code I scan is equal to the content of a column in a list

How can I apply a formula that condition the status column in the record that I will update?

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I did it by bringing the status in a label

LookUp(Invitados, Code=brsScanner.Value,Correo)

 

If(Label1_2.Text="No Registered", Patch(Invitados, First (Filter (Invitados, Code = brsScanner.Value)), {Estado: "Registered"}), Notify("The Employee has already entered", Warning));

View solution in original post

3 REPLIES 3
timl
Super User
Super User

Hi @Anonymous 

One way to do this would be to lookup the status of your target record. You could then Patch the record, only if the Status is "Not registered".

If(IsBlank(Lookup(employee, Status="Not registered")),
  Patch (employee, First (Filter (Employees, Code = brsScanner.Value)), {Status: "Registered"}),
  Notify ("The employee has already registered", Warning)
)

 

Anonymous
Not applicable

Hi @timl  It has not worked for me, even if the employee has an "Unregistered" status, he always goes to the notification, and the patch always ignores it.

Anonymous
Not applicable

I did it by bringing the status in a label

LookUp(Invitados, Code=brsScanner.Value,Correo)

 

If(Label1_2.Text="No Registered", Patch(Invitados, First (Filter (Invitados, Code = brsScanner.Value)), {Estado: "Registered"}), Notify("The Employee has already entered", Warning));

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,905)