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 / Patch another list in ...
Power Apps
Unanswered

Patch another list in SharePoint, based on the records from the Gallery

(0) ShareShare
ReportReport
Posted on by 195

Hi All,

 

I have 2 sharepoint lists masterlist and employeelist. Request ID exists in both tables where Request ID  is a foreign key in employee list. 

 

I have a search box which searches across the masterlist and display the result in Gallery. I have a revoke button in gallery, which should update the status of all employees to Revoked in childlist for that particular requestID

 

I tried to update the Status field to Revoked in EmployeeList, however couldn't because Gallery is populated with masterlist. Any idea how to proceed ?

 

Patch(EmployeeList, ThisItem.RequestID=MasterList.RequestID,{Status:Revoke}); // doesn't work

 

scr12.PNG

 

 

 

 

 

 

Categories:
  • KrishnaV Profile Picture
    5,023 on at

    use the patch as below:

    Patch(EmployeeList, Lookup(EmployeeList,RequestID = ThisItem.RequestID),{Status:Revoke});

     

    I hope this resolved your issue if you see any challenge let me know I am always happy to help.

    Regards,

    Krishna
    If this post helps, then please consider Accept it as the solution and give thumbs-up to help the other members find it more.

     

     

  • Kumar9024021 Profile Picture
    195 on at

     @KrishnaV 

     

    This only updates 1 record in child, if ID are similar. I want to update multiple childs, with same ID in child table, For eg: With ID 1, there are 3 childs.

     The below syntax shows Invalid argument type warning, as ID field in parent table is default ID field from SharePoint and RequestID in child is lookup 

    Patch(EmployeeList, Lookup(EmployeeList,RequestID = ThisItem.RequestID),{Status:Revoke});

     

    Parent table

     

    scr13.PNG

     

     

    Child Table

     

    Scr14.PNG

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @Kumar9024021 ,

     

    If the Status is choices type column, please try this to RevokeButton.OnSelect:

    UpdateIf(EmployeeList, RequestID.ID=ThisItem.ID,{Status:{Value:"Revoke"}}) 

    If the status is single line of text column, please try this.

    UpdateIf(EmployeeList, RequestID.ID=ThisItem.ID,{Status:"Revoke"}) 

     

    Hope this helps.

    Sik

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard