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

PDF a Sharepoint Word document, OneDrive breaks Doc Info

We're converting SharePoint documents to PDF via Flow.

It takes about a minute to convert a 100kB Word file to a PDF with all the same SharePoint metadata.

 

Issue

Some Quickparts that's take data from SharePoint columns (also available in the Document Information Panel) are not displayed correctly once a file is copied to OneDrive for Business. It's then converted to PDF incorrectly.

 

Flow summary

We use the OneDrive for Business (OD4B) PDF converter, which I can only get working on local documents in OneDrive. This means we have to copy the SharePoint (SP) document to OD4B before starting the conversion. The PDF is then copied back to the SP doc libary and metadata updated.

 

1 SP - For a selected item
2 SP - Get item
3 SP - Get file content
4 OD4B - Create copy of source file on OneDrive
5 OD4B - Convert file using path (Preview) - type PDF
6 OD4B - Create PDF on OneDrive
7 OD4B - Get PDF file content
8 SP - Create copy of PDF in doc library
9 SP - Get PDF item ID
10 SP - Update PDF columns
11 OD4B - Delete copied source file
12 OD4B - Delete pdf

 

Reproducing the error 

We use Quick Parts from SharePoint columns to input controlled document information.

The data is editable in the document information panel (DIP).

This information is changing at the first OD4B step, step 4.

In particular, lookup columns seem to return the list location, not the list value.

e.g. Document type: "Report", instead displays "4" (user selects from list: Calculation, Specification, Proposal, Report etc.)

 

More information

From further testing outside of Flow, it appears that SharePoint DIP / quickparts don't work after a document is copied into OneDrive for Business. 

If said doc is opened in Word online, it displays correctly

If said doc is opened in Word client, it throws this error:

 

Some external data was not retrieved. The form will load without the requested data.

(more details - this repeats for each error)

The query cannot be run for the following DataObject: list_22a361f3-b0c4-4912-a250-43095581c6e7
Document Information Panel cannot run the specified query.
The SOAP response indicates that an error occurred on the server:

Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.
<detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    List does not exist.
    The page you selected contains a list that does not exist.  It may have been deleted by another user.
    </errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000006</errorcode></detail>

 

...

 

So I'm guessing the XML docprops, which rely on the original Sharepoint column information, lose their datasource when the document is copied out of the Sharepoint library.

 

Request

Thanks in advance for any workarounds / solutions.

 

1 ACCEPTED SOLUTION

Accepted Solutions
johnnyshield
Level: Powered On

Re: PDF a Sharepoint Word document, OneDrive breaks Doc Info

Just to close this one out, the newish Convert Word to PDF, Word online (Business) connector solves this issue.

View solution in original post

4 REPLIES 4
johnnyshield
Level: Powered On

Re: PDF a Sharepoint Word document, OneDrive breaks Doc Info

 
Community Support Team
Community Support Team

Re: PDF a Sharepoint Word document, OneDrive breaks Doc Info

Hi @johnnyshield,

 

Could you please share a screenshot of your flow's configuration?

Could you please show more details about your issue?

 

I have made a test on my side and don't have the issue that you mentioned. My flow's configuration as below:1.JPG

 

2.JPG

The flow works successfully as below:3.JPG

The PDF file opens well as below:4.JPG

 

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Get-a-file-FROM-Sharepoint-Doc-Library-T...

 

More details about strating a flow from Flow Launch Panel of SharePoint list or library, please check the following article:

https://flow.microsoft.com/en-us/blog/introducing-flow-launch-panel-in-sharepoint-lists-and-librarie...

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
johnnyshield
Level: Powered On

Re: PDF a Sharepoint Word document, OneDrive breaks Doc Info

Hi Kris, your Flow is identical to mine (no need for screenshot) and works well - just like mine does - on documents that don't contain Sharepoint lookup column quickparts.

 

The issue I described is that the process of copying the Word file to OneDrive breaks the link to Sharepoint column data, so it doesn't display or convert to PDF correctly.

 

Example images below.

 

flow conversion - what it should look like.pngWhat is displayed in Sharepoint (Word 2013)flow conversion - how it comes out.pngHow it comes out - Sharepoint lookup column data wrong

Because the file is copied out of Sharepoint, I wouldn't expect the Quickparts to still be linked, however they don't even display the old value. They display the list item ID #.

 

So, can these be updated in OneDrive? e.g. modifying XML, update Word file etc.

johnnyshield
Level: Powered On

Re: PDF a Sharepoint Word document, OneDrive breaks Doc Info

Just to close this one out, the newish Convert Word to PDF, Word online (Business) connector solves this issue.

View solution in original post

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
Users Online
Currently online: 385 members 6,499 guests
Please welcome our newest community members: