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 collection to sh...
Power Apps
Unanswered

patch collection to sharepoint list

(0) ShareShare
ReportReport
Posted on by

i want to patch collection of  records of login user to sharepoint list. again next time the user should see his records and edit them in the grid table created in gallery.

i created collection in App Start & add collect function in Gallery Record to collect the changes.

how to create patch function for this . if i use below patch it is created repeated duplicate records.

OnStart:
ClearCollect(Colpat,ShowColumns(Table(Defaults('ABC')),"User","Manager","Title","Status","CompletedDate","ID"));
Clear(Colpat)

 

Collect button in gallery:
Collect(Colpat,{Title:ThisItem.Title,Status:Dropdown.SelectedText.Value,User:ThisItem.'Created By',Manager:ThisItem.manager,CompletedDate:DatePicker1.SelectedDate})


Save button outside gallery:
Patch(
'ABC',
Colpat)

Categories:
I have the same question (0)
  • Geeks_D Profile Picture
    1,169 on at

     

    You will need to Add the item ID to the Collection 
    And use the ID for a Lookup formula to patch the corresponding record in Sharepoint List 

    The Patch will be 
    Patch (ABC, Lookup(ABC, ID = Collection.ID, {Colpat})))

     

    I guess the Collection is just one single record, If they are multiple records you need to use the ForAll function 

  • venky232 Profile Picture
    on at

    not working
    ForAll(Patch (ABC, Lookup(ABC, ID = Colpat.ID, {Colpat})))

     

    Added ID in collect button
    Collect button in gallery:
    Collect(Colpat,{Title:ThisItem.Title,Status:Dropdown.SelectedText.Value,User:ThisItem.'Created By',Manager:ThisItem.manager,CompletedDate:DatePicker1.SelectedDate,'ID':ThisItem.ID})

  • Geeks_D Profile Picture
    1,169 on at

    I guess you have Multiple records which is why you use ForAll 

    The ForAll need a collection to pick item one after the other 

    ForAll(Colpat, Patch(ABC, Lookup(ABC, Id= Colpat.ID,{PatchColumns}))) 

    or 

    ForAll(Colpat,UpdateIf(ABC, ID = Colpat.ID,{Columns}))

  • venky232 Profile Picture
    on at

    not working above codes
    Multiple records which is why you use ForAll-Yes
    but by using below code i can able to create mutiple records in single shot. but i want to avoid duplicate and edit submitted records.
    Patch(
    'ABC',
    Colpat)

  • Geeks_D Profile Picture
    1,169 on at

    Seems I got it wrong 
    You bring some records up 
    But u do not edit all of them 

    And want only patch on the edited records to the Datasource?

  • venky232 Profile Picture
    on at

    Yes,bringing records from another list. And patching them to new sp list

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard