Today, I was asked about triggering a flow only when a document set is created.
I started by enabling Document sets on my site. (note that this is a site collection feature that you need to enable)
Then I created my flow that triggers on the creation or modification of a file. And I’m initialising a variable with the content type Id of the document set that was added:
Most of the hard work has now been done. I could now add a condition that checks for the Content type Id to start with 0x0120D520.
But this means that my flow will kick off and I would end it immediately. This is a waste of my number of flow runs. So I would pay for these flows to run even though I don’t want them to run.
It would be nice if triggers could handle filters like in the Get Files action where a Filter Query can be configured.
If you only want to do things when a document set is created and you find that updates to the document set trigger the flow again then you could create a flow like this:

The above flow checks the content type id of the triggering document/folder or document set and then only runs my code when the modified date and the creation date are the same.


Leave a Reply
You must be logged in to post a comment.