I have created a flow that when a folder is created in a specific location in sharepoint, it will create a sub-folder within it.
However, if I create another folder in the new one I have created, it triggers a loop and creates a new folder 'with the same name' in the original location with the sub-folder added.
How can I make the trigger only happen when a folder is created in a specific location, and not when a folder is created within a sub-folder in this specific location?
Solved! Go to Solution.
On your trigger you can add a trigger condition to check the path to see if it's within your or not.
See example below where I only want the flow to run when the file/folder being created is directly within the Clients folder.
//Only trigger if the item was created at the top level of our Clients folder
@equals(triggerOutputs()?['body/{Path}'], 'Documents/Clients/')
To add Trigger conditions, on the trigger click on the three dots ... then click on Settings and Add under Trigger Conditions.
In my example below, I've got two triggers. If it's in the Clients folder and only if it's a folder that was created. If you only wanted to trigger it to work with files (and not folders) then you could set that condition to false.
On your trigger you can add a trigger condition to check the path to see if it's within your or not.
See example below where I only want the flow to run when the file/folder being created is directly within the Clients folder.
//Only trigger if the item was created at the top level of our Clients folder
@equals(triggerOutputs()?['body/{Path}'], 'Documents/Clients/')
To add Trigger conditions, on the trigger click on the three dots ... then click on Settings and Add under Trigger Conditions.
In my example below, I've got two triggers. If it's in the Clients folder and only if it's a folder that was created. If you only wanted to trigger it to work with files (and not folders) then you could set that condition to false.
That worked! Thankyou so much
User | Count |
---|---|
26 | |
14 | |
12 | |
10 | |
8 |
User | Count |
---|---|
50 | |
29 | |
28 | |
24 | |
20 |