cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AFD256
Level: Powered On

Convert_Word_Document_to_PDF Flow failing - works when resubmitting

I've a Flow that triggers when a new SharePoint list item is created, then uses the "Populate a Microsoft Word Template" (template stored on SharePoint) to combine the columns from the list item with the Word document, then uses "Microsoft Word Document to PDF" to make a PDF that is emailed to a user.

 

This has ran ~70 times this week without error. This morning there were over 20 successfull runs but I also got three failed attempts - errors were:

  1. Action 'Get_file_content_using_path' failed
    File not found clientRequestId: aae7e4c2-c128-493b-8bfd-755591fd5c98 serviceRequestId: aae7e4c2-c128-493b-8bfd-755591fd5c98
  2. Action 'Get_file_content_using_path' failed
    File not found clientRequestId: 9e6750d0-1982-43ea-8a26-dcb22e34a15d serviceRequestId: 9e6750d0-1982-43ea-8a26-dcb22e34a15d
  3. Action 'Convert_Word_Document_to_PDF' failed There was an error accessing the file. Please try again or select a different file.
    clientRequestId: 0f161211-1a33-4bb7-8743-2c89988cff26

 

1&2 worked right away upon resumitting the Flow - can attribute this to the submitted image hadnt finished uploading. Plan on introducing a pause to avoid this in future.

3 failed again initially with the same error, then worked on the next attempt.

Haven't a clue about why this failed then worked?

 

Any ideas how I avoid seeing this again?

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

Hey @AFD256 

 

Can you share a screenshot of the flow? 

 

How are you passing the word file content to convert to PDF action? If it is directly the document output from the populate action, or is it the get file content and then convert to pdf action? 

 

If you are saving the file and then getting the content of the word file and then creating a pdf out of it, I would suggest to add delays inorder to allow the file creation appropriately (as you have mentioned). We might be able to better understand the issue if you could share a screenshot of the flow. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

10 REPLIES 10
Dual Super User
Dual Super User

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

Hey @AFD256 

 

Can you share a screenshot of the flow? 

 

How are you passing the word file content to convert to PDF action? If it is directly the document output from the populate action, or is it the get file content and then convert to pdf action? 

 

If you are saving the file and then getting the content of the word file and then creating a pdf out of it, I would suggest to add delays inorder to allow the file creation appropriately (as you have mentioned). We might be able to better understand the issue if you could share a screenshot of the flow. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

AFD256
Level: Powered On

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

@yashag2255thanks for the quick response.

 

I'll have to upload a screenshot later on when I can upload to an image host...

I've now added in a 15 second delay right after the trigger and another 15 second delay when the Word file is created.

 

Flow looks like:

 

  1. SharePoint: When an item is created
  2. Delay (15 seconds)
  3. SharePoint: Get file content using path (uploaded image name from step 1)
  4. Compose (Formatdatetime to dd/MM/yyyy)
  5. Word: Populate a Microsoft Word Template
  6. SharePoint: Create file (.docx)
  7. Delay (15 seconds)
  8. Word: Convert Word Document to PDF (file create from step 5)
  9. SharePoint: Create file (.pdf)
  10. Outlook: Send an email

 

I'll post back on the results

 

 

Dual Super User
Dual Super User

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

Hey @AFD256 

 

All looks good to me. 

 

A few things: 

1. In step 3, are you trying to get an attachments? (are you working on a list or items in doc library?)

2. If working with list, you might wanna add the step get item and provide the ID from the trigger.

3. In step 8, what are you using to provide the file for converting to PDF? 

Are you saving both word .docx and .pdf files? 

 

Again, if these do not work and when you possible, if you can upload screenshots, it will be easier to identify the issue. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

AFD256
Level: Powered On

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

Hi @yashag2255 

 

  1. This Flow's List Item is triggered from PowerApps. The App does two things, captures the users responses to questions and lets them take a photo. When the New Item form is submitted, it takes the uploaded filename and includes it in the new List Item. Step 3 grabs the referenced image content saved in a doc library using the file name.
  2. Not sure how this would fit in?
  3. This is the Word file that has been saved to SharePoint (Step 6). Can I use the output of Populate a Microsoft Word Template (Step 5) for this? Saving both the Word and PDF file back to SharePoint - only really need to keep the PDF as a backup but it's not like space is an issue on our tennant, but if it's more efficent I can update this.

 

Dual Super User
Dual Super User

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

Hey @AFD256 

 

So If the flow is triggered from PowerApps, you should not use the When an item is created trigger. (You should only use one trigger in a flow). 

 

But I am assuming that what you mean is, you create the item in SP from PowerApps and users upload an image on that form that is added as an attachment on the SP list. 

 

You can absolutely use the output of the Populate word template action to create the PDF. If there is no need of the word document to be stored as a .docx file, you can get rid of that action. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
AFD256
Level: Powered On

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

PowerApps has a seperate Flow action to create the image in a Document Library

This Flow is triggered when the SharePoint List Item is created referencing the saved image

 

Cool - I'll remove that step 🙂

Dual Super User
Dual Super User

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

Hey @AFD256 

 

Alright! Makes sense now. Please check the above recommendations and see if that resolves the issue. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

AFD256
Level: Powered On

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

1.PNG

 

2.PNG

 

3.PNG

Flow steps (didnt know I could upload direct to here...)

No end users have used this since I've introduced the Delay actions, so I'm waiting till Monday morning for the acid test.

 

I can't see how I remove creating the Word file from this, as the Convert Word Document to PDF wants a file location?

It's not an issue, I can always add in a step to remove the Word file

Dual Super User
Dual Super User

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

Hey @AFD256 

 

Yes you need to first create the word .docx file (i confused that with the pdf one). And this flow seems correct to me now with the delay actions. Ensure that you are providing the correct paths on each action for the files. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

AFD256
Level: Powered On

Re: Convert_Word_Document_to_PDF Flow failing - works when resubmitting

So far so good - the Flow has run 18 times in the past hour with no failures/errors

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,832)