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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Wait for file to be up...
Power Automate
Answered

Wait for file to be uploaded to library

(0) ShareShare
ReportReport
Posted on by

Hi

 

I have a Flow that generates a PDF of the list item via OneDrive, once it is converted it moves the files to a SharePoint Library, this file is then sent via email to the creator.

 

Sometimes it takes 5+ minutes for Flow/OneDrive to generate the PDF and if the file is not already in the library then the next action which sends the email fails. Is there a way to make the Flow to wait for the file to be uploaded and automatically trigger the email when the file gets uploaded?

 

Capture.JPG

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    I would try putting a DoUntil loop in front of the email.  Then do a Get File {properties only) action inside the loop and test to see if the result is null.  When the file is returned then exit the loop and proceed with the email.  I would also put a delay in the loop before the get file to only do it once a minute or once every 30 seconds.

  • efialttes Profile Picture
    14,756 on at

    @Anonymous 

    All pdf files you create are stored in the same library / directory, right?

    If so, did you try to split your flow in two?

    I mean, the first flow keeps the current trigger: when an item is created flow#1 creates a file and converts it to pdf

    The second flow will trigger on when a file is created: use as filters the target directory and the extension (.pdf). If any of these conditions do not apply, flow#2 will terminate its execution vie Terminate action block. If both of them apply, flow#2 will move the file to sharepoint etc.

    You can also keep a single flow by adding the second trigger inside, just between "Convert file" and "Move file to sharepoint" action blocks, but this option is a bit more complex in my opinion and would probably require a paralel branch in case PDF conversion is too fast.

    Hope this helps

  • v-bacao-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Perhaps you could  consider adding two Delay action after Create file action and Get file content action, with an interval of 3-5 minutes.

    29.PNG

    Please take a try.

     

    Best Regards,

  • Community Power Platform Member Profile Picture
    on at

    @efialttes wrote:

    @Anonymous 

    All pdf files you create are stored in the same library / directory, right?

    If so, did you try to split your flow in two?

    I mean, the first flow keeps the current trigger: when an item is created flow#1 creates a file and converts it to pdf

    The second flow will trigger on when a file is created: use as filters the target directory and the extension (.pdf). If any of these conditions do not apply, flow#2 will terminate its execution vie Terminate action block. If both of them apply, flow#2 will move the file to sharepoint etc.

    You can also keep a single flow by adding the second trigger inside, just between "Convert file" and "Move file to sharepoint" action blocks, but this option is a bit more complex in my opinion and would probably require a paralel branch in case PDF conversion is too fast.

    Hope this helps


    Thank you. This is a good idea but how can I get the ID from the First flow? I need to ensure the details reach the same person who raised the request. 

  • Community Power Platform Member Profile Picture
    on at

    @v-bacao-msft wrote:

    Hi @Anonymous ,

     

    Perhaps you could  consider adding two Delay action after Create file action and Get file content action, with an interval of 3-5 minutes.

    29.PNG

    Please take a try.

     

    Best Regards,


    Thanks. I do not want every request to wait for 6 minutes. In most instances the PDF is created within a minute but there are some where it takes 5+ minutes. 

  • Community Power Platform Member Profile Picture
    on at

    @Pstork1 wrote:

    I would try putting a DoUntil loop in front of the email.  Then do a Get File {properties only) action inside the loop and test to see if the result is null.  When the file is returned then exit the loop and proceed with the email.  I would also put a delay in the loop before the get file to only do it once a minute or once every 30 seconds.


    Thanks. I tried to implement it but I cant make it work. I am trying to make the loop check if the item exists every 30 seconds. 

    Capture.JPG

  • efialttes Profile Picture
    14,756 on at
    Hi!
    I see your point... You can add the ID as part of the filename, or store in a new sp list an item matching filename, ID and whatever other info you require in the second flow
    I am currently in a local Flow event, if you need it I can work on an example in some hours
    Hope this helps
  • Community Power Platform Member Profile Picture
    on at

    I tried my best to figure out how to do it. I have the ID number in the file names but it is not possible to figure out what the ID would be from the first flow. I could do it by last uploaded date and person but there may be instances when multiple requests could be uploaded at the same time by same or different users. 

     

    It would be of great help if you could provide an example on how to achieve using 2 flows. 

  • efialttes Profile Picture
    14,756 on at

    @Anonymous

    I am working on an example flow. I need to confirm the following: Are you using OneDrive or OneDrive for Business?

  • Community Power Platform Member Profile Picture
    on at

    I am using OneDrive for Business.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard