cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MartinKuzmicz
Level: Powered On

SharePoint check if the item is a folder or file

Hi, 

I'm using "When a file is created (properties only)" as a trigger.

The will trigger also when a folder is created. So, is anyway if the flow checks if the "file" /item was a folder or file?

The reason I need is that later in my flow I'm using "Get file Content" and I'm getting an error when the "file" from the trigger was a folder.

1 ACCEPTED SOLUTION

Accepted Solutions
MartinKuzmicz
Level: Powered On

Re: SharePoint check if the item is a folder or file

Sure.

So I have compared if the "Name" is equal to "File name with extension" which both I'm taking from the trigger "When file/item was created"

I'm not sure if it's the best solution, but it's working for me.

 

2018.07.11_15h26m25s_008_.jpg2018.07.11_15h23m41s_007_.jpg

View solution in original post

7 REPLIES 7
Bizzo
Level 8

Re: SharePoint check if the item is a folder or file

Hi @MartinKuzmicz,

 

Could you try a condition in your flow and only run if the filename contains a period (".")? Not a perfect solution, but might do the trick?

 

image.png

MartinKuzmicz
Level: Powered On

Re: SharePoint check if the item is a folder or file

Not really, because I know that users may use "." in the folder name. 

But I think, I found the solution. Thanks for the reply.

Bizzo
Level 8

Re: SharePoint check if the item is a folder or file

@MartinKuzmiczCan you please share the solution, so anyone who finds this will be able to use your answer?

MartinKuzmicz
Level: Powered On

Re: SharePoint check if the item is a folder or file

Sure.

So I have compared if the "Name" is equal to "File name with extension" which both I'm taking from the trigger "When file/item was created"

I'm not sure if it's the best solution, but it's working for me.

 

2018.07.11_15h26m25s_008_.jpg2018.07.11_15h23m41s_007_.jpg

View solution in original post

Highlighted
kapardhi
Level: Powered On

Re: SharePoint check if the item is a folder or file

Hello @MartinKuzmicz

I'm working on a similar flow, however when I'm using the trigger "when a file is created (Properties only)", perform a test run and when I create a folder in the specified "Folder Id", the flow is not recognizing the folder.

Bizzo
Level 8

not Re: SharePoint check if the item is a folder or file

I'm not sure if I'd be able to help, but I don't completely understand what you mean with your message. (Sorry! Smiley Sad) Can you provide more details?

SoniaGr
Level: Powered On

Re: SharePoint check if the item is a folder or file

Hi, I was looking for the same thing and I have found an action for checking if a file is a folder, so maybe it will be of help for someone else. Here is the flow sequence:

 

flow.png

 

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,909)