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

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
    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
    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

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