Mar 28 2019 10:22 AM
I'm trying to use the Convert Word Document to PDF action in a Flow. There are three parameters that have to be entered:
The parameter that I'm having an issue with is the File. The flow works if I choose the specific document from the library but I want it to be dynamic so that when the user starts a Flow on the document it will convert that one, so I don't want to hardcode the document name.
For the File property I'm using the property from a previous step with the file name called File name with extension.
When I run the flow I get an error, "There was an error accessing the file. Please try again or select a different file."
Can I not use dynamic content for the File property?
Thanks
Jan 12 2020 10:04 PM
Thanks for sharing, I am stuck on this exact issue too and am unable to convert a Word Doc to PDF within Sharepoint. Has there been any developments in the mean time?
If not, is it possible you paste the flow you've developed as a workaround which you have discussed? would be good to mimick it myself in the interim till an MS solution is developed.
Jan 13 2020 10:36 AM
@Roghan This can be used to get a pdf version of a document: https://github.com/SharePoint/sp-dev-fx-extensions/tree/master/samples/js-command-convert-to-pdf.
This can be used to generate Word Docuements or PDFs from data stored in your sharepoint lists using a word template: https://github.com/russgove/sp-dev-fx-extensions/tree/dev/samples/react-command-generate-documents
Jan 19 2020 07:53 PM
@Russell Gove thanks for sharing, I am keen to try point 1: "This can be used to get a pdf version of a document" but am unable to deduce from the link you shared how to go about this? Any easy to follow guide you have seen around?
Feb 02 2020 03:20 PM - edited Feb 02 2020 03:26 PM
After some substantial trial and error I believe this usually happens when a file has been created, but isn't "ready yet". Its as if its returning the file properties that can work with Sharepoint's REST API, without actually determining if the information can be discovered by Microsoft's graph API (which I am now convinced is what that action is using).
A workaround I have found is to wrap the action in a while loop with a success and failure branch. On failure, wait 10 seconds and then restart the loop. It isn't perfect of course, but 99% of the time it fails once or twice, then goes through
Feb 03 2020 02:12 PM
Mar 03 2020 07:54 PM
Mar 13 2020 07:38 AM
@ThreeTen22 sounds like a good workaround to me, thanks for sharing.
Can you please describe how to use the success/failure branch? I don't know how to do this.
Thanks a lot!
Oct 28 2020 02:59 AM
@Rich Koneval
I found a solution in my case.
The 'FullPath' for my word document started with "Shared Documents", given I was using a SharePoint file. This was being merged with the 'Library Name' input, which was creating the wrong location.
My solution was to remove the text "Shared Documents" from the 'FullPath' dynamic content. I used a replace function as follows;
=replace(text, oldText, newText)
Nov 01 2020 05:16 PM
Nov 26 2020 09:22 AM - edited Nov 26 2020 09:50 AM
I tried the suggestions by @sips1 (Option 1) and @evancoulson (Option 2), and both worked for me.
Adding screenshots to help anyone who stumbles upon this issue in the future.
Option 1 [using 'Name' dynamic content]:
"Location": The SharePoint site
"File": Provide the path from the "Documents" folder (or your Document Library location), until the file.
For example, if the full path is "/Shared Documents/Documents/<FolderA>/<filename.docx>", then put it as:
/FolderA/<"Name" dynamic content>
Option 2 [using 'Path' dynamic content]:
"Location": The SharePoint site
"File": replace(outputs('Save_the_file_in_SharePoint')?['body/Path'], '/Shared Documents', '')
Option 2 is less error-prone so I'd prefer that!
Hope this helps :)
Jan 29 2021 07:59 AM
Unfortunatelly your solution is not working for me, though I think I use same case - filed template, created docx file and trying to convert
Jan 29 2021 08:12 AM
Do not keep trying to convert a SharePoint file to PDF - It won't work, I remember it used to be an error with the SharePoint connector (that thing is always buggy... Microsoft)
You'll need to convert the file from OneDrive to PDF, then move it to SharePoint. Finally delete it from the OneDrive. That's the "work around" sadly, but if there's no issue with having the file in your OneDrive first, that should do it.
-Here's the way I did it: https://www.youtube.com/watch?v=vUoRAxFNxlA (tutorial I found back then)
Hope that works for you.
Jan 29 2021 08:34 AM
I just managed!!! @RodoMCP
I'm so surprised, but I did it!
The funny thing is it's so simply and so dummy...
After creating sharepoint file I had added "get file properties"
In the "convert...." for file name I've chosen the folder where my form answers should be landing and some past file - just to see what's entered to file name, than deleted file name itself and replaced it with property "file name with extension".