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 Inactive Value f...
Power Apps
Answered

Patch Inactive Value for all Employee Name

(0) ShareShare
ReportReport
Posted on by 136

Hi Community,
Firstly, Happy New Year 😊

 

I have a requirement,
I have an Employee Marker Column, When I hit the Delete Button for a Particular Employee records in the App , the delete button has to patch the Employee Marker column as "Inactive" for all the records of that particular Employee in the SharePoint List.

 

PrudhviL_0-1704212844468.pngPrudhviL_1-1704213159597.png

 

This is the formula I tried but is not working.

Patch(
 'NewList',
 ForAll(
 Gallery2.AllItems,
 LookUp(
 'NewList',
 EmployeeName.DisplayName = Gallery1.Selected.EmployeeName.DisplayName,
 {'Employee Marker': "Inactive"}
 )
 )
);

 Please help me with this.

@LaurensM @AARON_C @Rajkumar_404 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @PrudhviL ,

    If you simply want to mark all records for the selected employee as inactive

    UpdateIf(
     'NewList',
     EmployeeName.DisplayName = Gallery1.Selected.EmployeeName.DisplayName,
     {'Employee Marker': "Inactive"}
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    Hi @PrudhviL , Try this:

    ForAll(
     Filter('NewList', 
     EmployeeName.DisplayName = Gallery1.Selected.EmployeeName.DisplayName
     ) As var,
     Patch(
     'NewList',
     LookUp(
     'NewList',
     EmployeeName.DisplayName = var.DisplayName,
     {'Employee Marker': "Inactive"}
     )
     )
    );

    -----------------------------------------------------------------------------------------------------------------------------

    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


  • PrudhviL Profile Picture
    136 on at

    Hello @WarrenBelz @ANB 

    Thank you so much for your reply.
    However each employee has more than 200 items in my SP list and it is taking more than a minute for the process to complete. 
    Also, I know that If we write the ForAll inside the Patch it is more Efficient than ForAll Outside Patch. So, I used this Formula suggested by @LaurensM . Is there any way that we can do it quickly?

     
    Patch(
     NewList,
     ForAll(
     Filter(
     NewList,
     Gallery1.Selected.EmployeeName.Email = EmployeeName.Email
     ),
     {
     ID: ID,
     'Employee Marker': "Inactive"
     }
     )
    );





  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @PrudhviL ,

    If speed is the issue, then all I would improve here is the Ambiguity issue

    Patch(
     NewList,
     ForAll(
     Filter(
     NewList,
     Gallery1.Selected.EmployeeName.Email = EmployeeName.Email
     ) As _Data,
     {
     ID: _Data.ID,
     'Employee Marker': "Inactive"
     }
     )
    );

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    @PrudhviL You can give a try using power automate.

     

    -----------------------------------------------------------------------------------------------------------------------------

    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


  • PrudhviL Profile Picture
    136 on at

    Hello @WarrenBelz 
    Thanks for the reply I have tried the formula and it's still taking at least 30 secs for the delete to complete . Is there a way to make it faster like 10-15 secs.

    Patch(
     NewList,
     ForAll(
     Filter(
     NewList,
     Gallery1.Selected.Employee.Email = Employee.Email
     ) As _Data,
     {
     ID:_Data.ID, 
     EmployeeMarker: "Inactive"
     }
     )
    );

     
    Hello @ANB . Thank you for your reply But I cannot use Power Automate since it's not in the Project Scope. I only have to use Power Apps and SP list.

  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @PrudhviL ,

    Sorry, a bulk Patch is as quick as you are going to get. You could try this

    With(
     {
     _List:
     Filter(
     NewList,
     Gallery1.Selected.Employee.Email = Employee.Email
     )
     },
     Patch(
     NewList,
     ForAll(
     _List As _Data,
     {
     ID:_Data.ID, 
     EmployeeMarker: "Inactive"
     }
     )
    );

    but I do not think it will make much of a difference.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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 739 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 268

Last 30 days Overall leaderboard