Power Automate
Trigger flow when a folder is created in the SharePoint library

Trigger flow when a folder is created in the SharePoint library

There are many triggers available for SharePoint list and libraries but in some cases, the flow should be triggered only a folder is created or a file is created inside the library, there are no direct triggers available but with the help of conditions we can trigger the flow when needed.

We are going to make use of Trigger conditions in the flow trigger. In this example, we used the “When a file is created (properties only)” trigger.

SharePoint returns the “IsFolder” value whenever the flow is triggered, we will use it in the trigger conditions.

Trigger Conditions
@equals(triggerOutputs()?['body/{IsFolder}'],true)

Now the flow will trigger whenever the folder is created. It can be changed vice-versa if the flow needs to be triggered only a file is created then we can make the condition as false.

But here is one additional use case, if the flow needs to be triggered when a folder is created as a Parent folder and it should not be triggered when it is created inside another folder.

We need to make use of the “LinktoItem” property and see whether it is a parent folder.

Trigger Condition
@equals(length(split(split(triggerOutputs()?['body/{Link}'],'LibraryNameFromURL')[1],'/')),2)

Please post your queries in the comment section. Happy Building šŸ™‚

2

2 thoughts on “Trigger flow when a folder is created in the SharePoint library

Leave a Reply

Newsletter Signup

Subscribe to our weekly newsletter below and never miss out the latest updates

%d bloggers like this: