Background
The ultimate requirement is an administrator function within an app to clear down a set of sharepoint lists that the wider app populates. We also want these to be restorable in the case of admin-users doing this when not appropriate. The happy part of where I am at with this is I have something working (on the face of it). This dumps the contents of each list's items to a spreadsheet. A restore function reads these excel rows and recreates the list items.
They look good but of course the metadata is different. Particularly the 'Created By' field now takes the value of the administrator who triggered the restore, and not the real user who's use of the app created the original record. This is a problem because one of the lists contains sensitive data. So it is protected so that each user can only access the records they have created. The change in the 'Created By' settings means the wider app no longer functions correctly for non-admin users after a dump, clear and restore.
Cutting to the chase
I want the clear function to capture the id's of the recycle bin items it creates. A restore function could then simply use _api/web/recyclebin('<recycle bin item id>')/restore() to restore the item. I would need no dump function before the clear. But the method I use - the delete item task in power automate - does not seem to return this. Is there a way I can capture this from the delete?
Any help gratefully received.

Report
All responses (
Answers (