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 from Collection ...
Power Apps
Unanswered

Patch from Collection then remove record

(0) ShareShare
ReportReport
Posted on by 53

Hi,

I have developed an app that will work offline, when connected I have been able to patch the records from the collection to a sharepoint list. This is working fine, Is there a way to build into the ForAll function to delete the record from the collection once the record has been patched to the sharepoint list?

 

Thanks in Advance

Categories:
I have the same question (0)
  • Eickhel Profile Picture
    374 Most Valuable Professional on at

    Hey,

     

    The patch method returns the patched record so you can check if the records have been successfully patched. Regarding the deletion, why don't you use the Clear method to empty the collection?

  • Verified answer
    v-micsh-msft Profile Picture
    on at

    Hi @Jimbo1,

     

    " have been able to patch the records from the collection to a sharepoint list. "

     

    Could you please explain a bit for how the patch works to save the collection data into SharePoint list?

     

    As shared by @Eickhel, patch function would return the updated record once it succeed, so if here you are using forall () to patch the collection, the formula should be:

    Forall(Collection, patch(SPList, ....))

    You could either trying the following:

    1. Use Collect within the Forall Patch, to collect the updated record, then remove it from the collection:

    Forall(Collection, Collect(RemoveData, patch(SPList, ....)))

     2. After that, use lookup function to map the record in the old collection, and remove the records found:

    Remove(Collection, Filter(Collection, ID in RemoveData.ID))

    Regards,

    Michael

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard