cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jrath
Frequent Visitor

How do we add an enhancement request for the Power Automate Team - Sharepoint?

The SharePoint trigger - When a file is deleted, has an option to either monitor a folder or the site for a file deletion. Regardless of which option you use the results returned are DeletedItem . refer to this site: https://docs.microsoft.com/en-us/connectors/sharepointonline/#when-a-file-is-deleted for details. If you choose the option to monitor the site, the returned results in my case are useless without knowing the folder where the file was located. Enhancement request: Is it possible to add the folder path to the DeletedItem data?

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Super User
Super User

@jrath I have tried this work around, see if this works for you.

 

I have create a Sharepoint list which stores file name and path when an item is created:

jinivthakkar_0-1614328905202.png

My flow which creates item in list with filename and path

jinivthakkar_1-1614328986266.png

 

and then I have another flow just like you have, on deletion of file:

jinivthakkar_2-1614329058681.png

In this flow, when file is deleted I query the list created in step one and get the path of the file.

jinivthakkar_3-1614329151779.png

 

Hope this helps.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

View solution in original post

4 REPLIES 4
Expiscornovus
Super User
Super User

Hi @jrath,

 

You could post the enhancement request in the Power Automate Ideas section:

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas

 

I am also seeing an idea which looks pretty similar to your request btw:

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/SharePoint-When-a-file-is-deleted-Provide-a...

 

Hope this helps a bit?

jinivthakkar
Super User
Super User

@jrath I have tried this work around, see if this works for you.

 

I have create a Sharepoint list which stores file name and path when an item is created:

jinivthakkar_0-1614328905202.png

My flow which creates item in list with filename and path

jinivthakkar_1-1614328986266.png

 

and then I have another flow just like you have, on deletion of file:

jinivthakkar_2-1614329058681.png

In this flow, when file is deleted I query the list created in step one and get the path of the file.

jinivthakkar_3-1614329151779.png

 

Hope this helps.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

jrath
Frequent Visitor

jinivthakkar,

       it is sad that we have to create all of these workarounds because someone forgot to add a value to an output ... thanks ...

DamoBird365
Microsoft
Microsoft

Hi @jrath,

 

A possible option to explore is the Recycle Bin API.  

 

DamoBird365_0-1614365181812.png

From this you could filter the results which include the original path:

 

"AuthorEmail": "damien@abdndamodev.onmicrosoft.com",
"AuthorName": "Damien A Bird",
"DeletedByEmail": "damien@abdndamodev.onmicrosoft.com",
"DeletedByName": "Damien A Bird",
"DeletedDate": "2021-02-26T17:53:35Z",
"DeletedDateLocalFormatted": "2/26/2021 9:53 AM",
"DirName": "sites/DamoBird365/Shared Documents/General/Test1",
"DirNamePath": {
"__metadata": {
"type": "SP.ResourcePath"
},
"DecodedUrl": "sites/DamoBird365/Shared Documents/General/Test1"
},
"Id": "02489a69-8d79-4f5f-a355-2330ecd5cff8",
"ItemState": 1,
"ItemType": 1,
"LeafName": "test.txt",
"LeafNamePath": {
"__metadata": {
"type": "SP.ResourcePath"
},
"DecodedUrl": "test.txt"
},
"Size": "408",
"Title": "test.txt"

 

You could filter the array on "DeletedDate" and "Title" and then recover the "DirName".

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,350)