cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mike44
Helper III
Helper III

Convert Word Document to PDF

I've created a form where responses populate a word doc template and create a file in SharePoint.  This all works fine.  The next step should convert the document to a pdf, but I get an error that says --The selected file doesn't exist, please select a valid file and drive.  clientRequestId: 0b8924ab-4efe-47c3-991e-a8672fc6386e-- at the 'Convert Word Document to PDF step', However, it does exist.  I'm not sure what I'm doing wrong.  Below are some pictures of my flow up to that step.  Note: in the 'Convert to PDF' step, I've tried, from the 'Create File' step: ID, Name, and DisplayName.

1.png2.png

1 ACCEPTED SOLUTION

Accepted Solutions
Mike44
Helper III
Helper III

I finally have this working, however I could not get it to work using the 'Convert Word Doc to PDF' premium- Word Online (Business), which I do have an account for.  I had to use the OneDrive for Business - Convert file (Preview) in order to get it working.  Below is a screen shot of my flow.  More steps, but it works.

s1.png

 

s2.png

View solution in original post

6 REPLIES 6
Shujaath_Khan
Super User
Super User

Hi @Mike44 

after you create the file and before you start conversion can you add delay action ( may be a min) between  so file is ready for conversion

Shujaath_Khan_2-1657821455890.png

extra, and also instead of utcNow() can you change it to utcNow('yyyy-MM-dd') ignore if not needed

 

Thanks
Please click Accept as Solution on this reply if it helped to solve your issue, and thumbs-up if you feel this is useful or important in other ways as a boost.

MarconettiMarco
Super User
Super User

Hello @Mike44 ,

in the “Convert to Word Document to PDF” you’ve to search for the file identifier instead of the name.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

BR,

Marco

 

 

Added the delay and still the same results.  Below are the input and output, as well as evidence the file exists:

Input
{
"host": {
"connectionReferenceName": "shared_wordonlinebusiness",
"operationId": "GetFilePDF"
},
"parameters": {
"source": "groups/87b0142a-9021-4b6b-971d-4c9dc1c1a289",
"drive": "b!rfdGDOykRkOwSCfz6SzRuj1KuB7dnSZDuOxaMS6mOhQjwK5hxGOxSYKvS7ggoiln",
"file": "Maintenance request 231 Sullivan 2022-07-14T18_07_37.9182508Z.docx"
}

Output
{
"statusCode": 400,
"headers": {
"Pragma": "no-cache",
"x-ms-request-id": "bd76c020-9413-4183-b422-5535a4f49f58",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"Cache-Control": "no-store, no-cache",
"Set-Cookie": "ARRAffinity=430fde32acf620e94447c7e2e59908644804523c09f9a09b2273e2becc212387;Path=/;HttpOnly;Secure;Domain=wordonlinebusiness-usgv.azconn-gcc-usgv.p.azurewebsites.us,ARRAffinitySameSite=430fde32acf620e94447c7e2e59908644804523c09f9a09b2273e2becc212387;Path=/;HttpOnly;SameSite=None;Secure;Domain=wordonlinebusiness-usgv.azconn-gcc-usgv.p.azurewebsites.us",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "true",
"x-ms-apihub-obo": "true",
"Date": "Thu, 14 Jul 2022 18:08:41 GMT",
"Content-Length": "350",
"Content-Type": "application/json",
"Expires": "-1"
},
"body": {
"status": 400,
"message": "The selected file doesn't exist, please select a valid file and drive.\r\nclientRequestId: bd76c020-9413-4183-b422-5535a4f49f58",
"error": {
"message": "The selected file doesn't exist, please select a valid file and drive."
},
"source": "wordonlinebusiness-usgv.azconn-gcc-usgv.p.azurewebsites.us"
}
}

s1.png

Also try @MarconettiMarco inputs 

I don't have an option to select 'file identifier' or 'identifier' in the dynamic content.  I've tried 'ID' and get the same results.

Mike44
Helper III
Helper III

I finally have this working, however I could not get it to work using the 'Convert Word Doc to PDF' premium- Word Online (Business), which I do have an account for.  I had to use the OneDrive for Business - Convert file (Preview) in order to get it working.  Below is a screen shot of my flow.  More steps, but it works.

s1.png

 

s2.png

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,152)