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 / Logging remove() and p...
Power Apps
Answered

Logging remove() and patch to sp list

(0) ShareShare
ReportReport
Posted on by 4

Hello all, 

I have an app and I log user actions by patching form.lastsubmit for onsuccess method of form to a separate list. I can't figure out how to log deleted items using remove (). I figure I can get the selected item from the gallery before sending the remove (), but that seems sloppy as there is no real confirmation the remove happened. Any ideas how to do this right?

 

Thanks in advance! 

Categories:
  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @Dsynful1 

     

    Since the remove function returns something, you can use a collection when you do the remove function (just like when you do a patch). Weird thing is that when you collect, it returns all items that are NOT deleted.

    ClearCollect(collDeleted,Remove('Your Data Source',ThisItem))

    So with the collection, maybe you can do something like:

    If(!Isempty(collDeleted),Notify("Item was deleted"),Notify("Item was not deleted"))

    Not sure if it's 100% reliable, but this is the only one I know.

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Dsynful1 

    A couple of ideas

     

    1.
    - Get item before Remove()

    - Remove()

    - LookUp() list using first step, if Blank(), Patch() to recording list, else Notify()

     

    or, 

    2.

    - Add a helper column to your main list 

    - When items are removed, update this column with ‘1’,

    - Patch() to recording list

    - this won’t remove the item but you could using filtering in your app the filters out any 1s in the helper column 

    - run a regular Flow (daily, weekly, ??) that removes items from the main list where the helper column =1

     

    One of these options may help?

  • Dsynful1 Profile Picture
    4 on at

    Thanks to both of you for your responses. I like Eelman's first option as it is cleaner for my level of expertise, but I may end up checking into what remove() returns also down the line.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard