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?
Solved! Go to Solution.
Hi again!
Here you are the screenshots
First flow
Flow#1 is triggered whenever you select an item from a Sharepoint list. It gets SP item ID, for simplicity purposes example takes the same docx file from OneDrive4Business no matter the item selected, then converts it to pdf and stores it in the same OneDrive4Business folder. PDF filename is built with current date+current time+SP item ID
Second flow:
Flow#2 is triggered whenevera new file is created in OneDrive4Business Folder. It verifies its extension, if not pdf stop execution. If pdf, extracts SP item ID. For simplicity purposes example get tem description from the SP list, but you can customize it to update the item.
My final screenshot show how to trigger Flow#1 from Sharepoint, and the Get Item response in Flow#2
Hope this helps
Proud to be a Flownaut!
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.
@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
Proud to be a Flownaut!
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.
Please take a try.
Best Regards,
@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.
@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.
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.
@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.
Proud to be a Flownaut!
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.
@Anonymous
I am working on an example flow. I need to confirm the following: Are you using OneDrive or OneDrive for Business?
Proud to be a Flownaut!
I am using OneDrive for Business.
Hi again!
Here you are the screenshots
First flow
Flow#1 is triggered whenever you select an item from a Sharepoint list. It gets SP item ID, for simplicity purposes example takes the same docx file from OneDrive4Business no matter the item selected, then converts it to pdf and stores it in the same OneDrive4Business folder. PDF filename is built with current date+current time+SP item ID
Second flow:
Flow#2 is triggered whenevera new file is created in OneDrive4Business Folder. It verifies its extension, if not pdf stop execution. If pdf, extracts SP item ID. For simplicity purposes example get tem description from the SP list, but you can customize it to update the item.
My final screenshot show how to trigger Flow#1 from Sharepoint, and the Get Item response in Flow#2
Hope this helps
Proud to be a Flownaut!
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
90 | |
50 | |
36 | |
30 | |
27 |
User | Count |
---|---|
75 | |
60 | |
50 | |
43 | |
38 |