cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rabb76
Regular Visitor

Flow sees subfolders as files and fails - Statuscode 404

Please forgive my ignorance but i am VERY new to Power Automate. i have a flow that is supposed to delete SharePoint files older than 7 years (for testing purposes i have the flow set to copy the file for now)..

 

Everything appears to be fine until i get to the Apply to each ->Get file metadata step. The flow fails saying the file does not exist. When you look at the path it is listing the sub folders as the file identifier not an actual file.

 

I've included a screenshot of my flow. any help would be greatly appreciated.

 

Thanks

Flow1.PNGFlow2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Rabb76 this is quite an easy fix to filter out anything that's a folder. Assuming that you haven't created a custom content type for your folders, then you can target that specific content type name.

 

In you filter query, add an additional filter to say that you don't want to include folders. I have used:

ContentType ne 'Folder'

 

ne means not equal to.

 

So just add and ContentType ne 'Folder' and your should then only have files. Alternatively you could do some checking within your loop, as you can run a condition on the dynamic content "IsFolder".

View solution in original post

1 REPLY 1

Hi @Rabb76 this is quite an easy fix to filter out anything that's a folder. Assuming that you haven't created a custom content type for your folders, then you can target that specific content type name.

 

In you filter query, add an additional filter to say that you don't want to include folders. I have used:

ContentType ne 'Folder'

 

ne means not equal to.

 

So just add and ContentType ne 'Folder' and your should then only have files. Alternatively you could do some checking within your loop, as you can run a condition on the dynamic content "IsFolder".

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,549)