Tuesday, April 2, 2024

How to Import SharePoint 2013 List Items to LibreOffice Calc

There are many blog posts that discuss how to use "Open Remote..." within LibreOffice to work with documents hosted in either a SharePoint 2010 or 2013 environment. This incredibly useful, but it leaves out how to interact with SharePoint list items, in the use-case of building reports or simply wishing to work with other spreadsheet-spliced data. For reference, this is a common feature between SharePoint and MS Excel, but does not appear in any discussions or documentation for LibreOffice. To solve this, a few steps are needed that are not difficult, but require knowledge of which features to use. For completeness, the following steps were successful using Brave browser and LibreOffice 7.3.7.2 on Ubuntu Linux 22.04.4. NOTE - this workaround approach was necessary, as ActiveX is not available in the Linux environment and is likewise being phased out (to my knowledge) in Windows environment as well. 

Things needed:

  • User account and password with full rights to the desired SharePoint list.
  • SharePoint list view that displays all needed fields.

Steps to import list items to LibreOffice Calc:

1)  View the desired SharePoint list as XML. This can be done by building URL like this

http://sharepoint.com/_vti_bin/owssvr.dll?Cmd=Display&List={E04E74B3-93F2-43C8-831E-28490AEF31A7}&View={c64759da-2241-45a8-9fea-3cedaa948687}&Query=*&XMLDATA=TRUE

Notes:

  • The start of the link should correctly use either http: or https: as configured in your SharePoint environment. 
  • If the desired list is within a sub-site, append the sub-site to the beginning - http://sharepoint.com/subsite/...
  • The List and View GUIDs can be found editing the respective list view that contains all the desired columns or fields, then scrolling to the bottom of the settings and reviewing the "Web address for this mobile view:" section. Copy the respective string of characters to the proper place in the URL (List={} or View={}), placing the characters within the curly braces. NOTE - any uses of %2D should be replaced with a dash(-), as shown in the example.
List

View


2) Once the XML loads into the browser, right click within and select "Save as..."

3) Set the file type to "All Files", enter a file name within Name (ensuring that it ends with .XML), then save the file within the desired location. NOTE - This file will be needed in Step 5. Also, the browser may flag the file and prevent it from being downloaded. To continue, view the current downloads and select "Keep", to allow the XML file to be downloaded.


4) Within LibreOffice Calc, select Data, then "XML Source". NOTE it may be necessary to enable this feature by navigating to Tools, then Options, and enabling "Enable experimental features" under Advanced.


5) Click the folder button under "Source File" and select the XML file, saved from the browser.


6) Within "Ma to Document", select "ns3:row" (the fields underneath will all be selected). Set the "Mapped cell" to A1, using the selector to choose the A1 cell within Calc, then clicking the 



7) Click Import to complete the import. The fields can be updated and worked with as desired within Calc.