cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nir2103
Frequent Visitor

Create Folder when item is created and wait for file to be created in folder to continue flow using do until

Hi,

 

I built a flow that creates a folder when an item is created. The next step is to wait for a a user to create a file in the folder to continue the flow. I tried using do until but it is not working.

 

I used the below:

 

Nir2103_1-1630928528146.png

 

The list contents is actually a get files action.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Nir2103 ,

it should go as below:

  1. try to find the file
  2. store the output into an array variable (set, not append)
  3. do until the length of the variable is not greater than 0
    1. try to find the file again
    2. store the output into the array variable

image.png

plus some 'Delay' in the 'Do until' to check for the file on some regular basis, e.g. delay 30 minutes or 1hour, that's up to you.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

5 REPLIES 5
tom_riha
Super User
Super User

Hello @Nir2103 ,

I'm not sure if you can self-reference action inside the 'Do until'. Did you try to initialise an array variable, store the outputs from 'List contents' in that variable, and then use that variable in the condition?



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
Nir2103
Frequent Visitor

Hi @tom_riha ,

 

The flow itself creates the folder and I am not being able to initialize a variable in the middle of the flow.

The main goal here is for the flow to create the folder and wait until a file is created in that folder to continue the flow. I tried to use the do until the size (dynamic content from create folder action) of the folder is greater than 0 but it is not working.

Is there any other way I can achieve this?

Nir2103
Frequent Visitor

Hi @tom_riha ,

 

I tried the variable but can't make it work. Can you please help? I used append array variable and used 'body ' from get files(properties only) as value. It is returning [] as the folder is empty and in the Do Until I used VarTP is not equal to [] but is not working.

 

Nir2103_0-1631103399896.png

 

Hello @Nir2103 ,

it should go as below:

  1. try to find the file
  2. store the output into an array variable (set, not append)
  3. do until the length of the variable is not greater than 0
    1. try to find the file again
    2. store the output into the array variable

image.png

plus some 'Delay' in the 'Do until' to check for the file on some regular basis, e.g. delay 30 minutes or 1hour, that's up to you.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
Nir2103
Frequent Visitor

Hi @tom_riha ,

 

Thank you so much for your help. It is working now.

 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,856)