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 / Deleting a row from a ...
Power Apps
Answered

Deleting a row from a collection after submitting the form successfully

(0) ShareShare
ReportReport
Posted on by 43

Good day humans,

 

I have this application that can submit forms to a datasource.

Now, I tried implementing offline capability to this application which lead me on using collection (Coll_A) and localdata to store the submitted forms into a collection.

The user can still view the collection of forms submitted offline in the Gallery.

Now, the user can edit the forms and submit it.

Now, what I want is to delete that entry/row/form from the collection after successfully submitting it because there is now an internet connection.

 

I tried using:

Remove(Coll_A,ThisItem);

on the OnSelect property of my submit button. Unfortunately, it returns an error and it is considered an invalid argument.

 

Is the scenario I have in mind feasible? If yes, I hope you can help me build an approach to it.

 

Thank you!

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    Forms have a LastSubm function that stores data about the last record uploaded to a data source. I've not used it but maybe look into that for a solution.

    Sorry I couldn't be anymore help.
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @fpc-kdrosario ,

    Do you want to remove the record from the local collection when you submit the form data successfully?

     

    Based on the formula that you mentioned, I think there is something wrong with it. Please consider take a try with the following workaround:

    Set the OnSuccess property of the Edit form to following:

    Remove(Coll_A, LookUp(Coll_A, PrimaryColumn = EditForm1.LastSubmit.PrimaryColumn))

    or

    RemoveIf(Coll_A, PrimaryColumn = EditForm1.LastSubmit.PrimaryColumn)

    Note: I assume that you submit your Edit form using SubmitForm function. The PrimaryColumn represents the column in your data source, which could identify one record uniquely.

     

    If you use Patch function to submit your form data, please consider take a try with the following workaround:

    Set the OnSelect property of the "Submit" button to following:

    Set(SubmittedRecord, Patch('DataSource', Defaults('DataSource'), EditForm1.Updates));
    RemoveIf(Coll_A, PrimaryColumn = SubmittedRecord.PrimaryColumn)

     

    Best regards,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard