web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

'When an item is created' triggers infinitely

(0) ShareShare
ReportReport
Posted on by 8

I have a Flow which creates folders inside a Teams channel when this channel is created. So the trigger is 'When An Item is created' in Sharepoint(since the team channel creates a Folder in Sharepoint Library).

On triggering it creates Folders inside this new Channel, which is achieved by Create Folder activity at the 'NewItem/' location. This creates a new Folder inside the New Channel but it additionally creates a new folder in the Team's Sharepoint.

I understand that creating a New Folder in the ChannelFolder is triggering it again, Is there a way to escape this LoopPowerAutomate.pngew 

I have the same question (0)
  • Verified answer
    Nived_Nambiar Profile Picture
    18,029 Super User 2025 Season 2 on at
    Re: 'When an item is created' triggers infinitely

    Hi @deepesh1 

     

    For this , I would suggest a trigger condition which checks whether the folder is created in main folder where teams channel folder is created, if it is created in subfolder under channels folder, it should not trigger the process.

     

    I have developed a demo process

    Nived_Nambiar_0-1679819265579.png

     

     

    Here I am triggering a flow when a folder is created in Documents folder in sharepoint. 

    In compose function, you can see three components there.

     

    1) Full Path: the full path to folder created.

    2) Folder Path: the parent folder in which that folder is created.

    3)  3 rd section checks whether the folder is created under Document folder or not, in other word that expressions check whether the parent folder of the created folder is Documents folder.

    expression:  equals(triggerOutputs()?['body/{Path}'],'Shared Documents/')

     

    This expression you can insert into the trigger condition like below

    Nived_Nambiar_1-1679819575677.png

     

    Note: The folder Documents is appearing as Shared Documents when looking at power automate output. So before writing the trigger condition, check what is Parent folder for your created folder using the Folder variable [ discussed as second section] and then add the folder name correctly in that trigger condition instead of Shared Documents/  if it seems to be different for you.

     

    Hope this helps you 🙂

     

    Mark it as solution if it resolves your query

     

     

     

  • deepesh1 Profile Picture
    8 on at
    Re: 'When an item is created' triggers infinitely

    Thanks @Nived_Nambiar , That was very very helpful. Had a few questions:
    Did you Use Compose to defined all 3 variables in a single Action? I am not sure how you did the condition part.

    To make it work with you idea, I added a condition that just checks if FolderPath equals "Shared Documents/" and it worked like a charm! 

  • Verified answer
    Nived_Nambiar Profile Picture
    18,029 Super User 2025 Season 2 on at
    Re: 'When an item is created' triggers infinitely

    Hi @deepesh1 

     

    I think you are talking about this 

    Nived_Nambiar_0-1679834266004.png

     

    This is the settings done in the Trigger part, this is would prevent trigger the flow if this condition is not satisfied. 

     

    How you can add trigger condition , follow the steps:

    1. Click on settings in trigger by clicking on 3 dots (...)

    Nived_Nambiar_1-1679834424804.png

     

    2. Next  at the bottom, you can find the trigger condition, click add trigger condition

    Nived_Nambiar_2-1679834463173.png

     

    3. Add the trigger condition which i have shared earlier

     

     

    This would help to prevent the run from start if condition is not satisifed.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard