Folders-enabled SharePoint lists: Trigger a Flow only when Folders are modified VS only when Items (not folders) are modified

For organisational purposes or even for having different permissions in a SharePoint list, without having to handle item-level permissions, we can leverage folders in a list by enabling folders creation under the list advanced settings.

With folders in a list then we can break permissions in a folder instead of each item, and then grant access to a specific subset of list items in a SharePoint list.

When we create Power Automate flows based on SharePoint list item created or modified events (‘When an item is created’/’When an item is modified’), the Flow will be triggered by modifications/creation of items and also folders.

But sometimes we want to either avoid it to happen when folders are created or maybe trigger a flow only when a folder is added/modified.

Trigger a Flow only when items (not folders) are modified/created

If you want to trigger a Flow only when items are added/modified, you can add a trigger condition to the flow, with the following expression:

@equals(triggerBody()?['{IsFolder}'],false)

This will make the flow trigger only when a list item is added/modified.

Trigger a Flow only when folders are modified/created

If you want to trigger a flow only when a folder is added/modified, , you can add a trigger condition to the flow, with the following expression:

@equals(triggerBody()?['{IsFolder}'],true)

This will make the flow trigger only when a folder is added/modified in a list.

Conclusion

By using trigger conditions we can run flows only or list item updates, or only on folder updates within a list.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *