Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • venky232 Profile Picture
    on at
    Re: patch collection to sharepoint list

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

  • Geeks_D Profile Picture
    1,169 on at
    Re: patch collection to sharepoint list

    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
    Re: patch collection to sharepoint list

    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
    Re: patch collection to sharepoint list

    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
    Re: patch collection to sharepoint list

    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
    Re: patch collection to sharepoint list

     

    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 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard