CHUVASH.eu

CHunky Universe of Vigourous Astonishing SHarepoint :)

Export any web part from a SharePoint page

The blog post below describes the technical details about how Web Parts can be exported using a hidden tool in OOB SharePoint, though this requires manual assembling of a special url. If you are just interested in a solution for an easy Web Part Export function, just proceed directly to my new blog post where you can download my tool that you can add to your web browser.

 

[youtube https://www.youtube.com/watch?v=wL9y9E1aJy0]

Technical background

Almost all web parts can be exported from a SharePoint page. An exported web part  can be imported on another page or it can be used as a source in a module to provision pages. An exception is the XsltListViewWebPart, there you cannot enable exporting. I have used Glyn Clough’s method before which has worked although it is a complicated process. Now I have found another way for exporting any web part (even ListViewWebPart and XsltListViewWebPart) present on a page. A method that only involves a web browser.

How to export any web part

First, we need to find out the webpartid. To do so inspect the html markup with the web browser dev tools of your choice.

export-webpart-001

In SharePoint there is a hidden application page that exports web parts: /_vti_bin/exportwp.aspx. This page takes two query parameters:

  • pageurl. The absolute url of the page where the web part resides that you want to export
  • guidstring. The guid that is called webpartid in the markup on the page

So, suppose, you have this site: https://intranet.contoso.com and a web part (id: 0c3adfe9-8f5d-4432-918a-42410e4e324d) on a page https://intranet.contoso.com/Pages/default.aspx

This will be the resulting URL to export your webpart:

https://intranet.contoso.com/_vti_bin/exportwp.aspx?pageurl=https://intranet.contoso.com/Pages/default.aspx&guidstring=0c3adfe9-8f5d-4432-918a-42410e4e324d

Paste it into the web browser address bar and you’ll download an xml file with your web part definition. This method works in SharePoint 2010 and SharePoint 2013 and even in SharePoint Online (Office 365).

Sources

Natalia Tsymbalenko. Get the list view web part convertable

Maurice Prather. Exporting a ListViewWebPart

SharePoint StackExchange

I am glad to update my answer on SharePoint StackExchange site and provide a much easier way of exporting any web part from SharePoint.

Bookmarklet (update 2015-10-21)

Finally there is a bookmarklet for making Web Part Export a lot easier. See my new blog post for more details:

Advertisements

21 responses to “Export any web part from a SharePoint page

  1. Pradip 2015-03-04 at 07:27

    Awesome, trick!! It helped a lot to me! Thanks!!!

  2. JimH 2015-03-20 at 22:37

    Works like a charm, Thanks! We’re about to migrate to 2013, so I’m looking foward to testing this in 2013, given the changes to SPD.

  3. Amanda Sterner 2015-03-25 at 10:01

    Hi, I am trying to export a webpart from my site – but it’s not working. I get “error something went wrong”. Could you maybe take a look at my url and see if it’s correct? I am using SP Online.

    https://wwdemo11.sharepoint.com/teams/HR-hejaheja2//_vti_bin/exportwp.aspx?pageurl= https://wwdemo11.sharepoint.com/teams/HR-hejaheja2/_layouts/15/start.aspx&guidstring= ebf04c7a-600b-4a16-bf28-a104372bef56

    Where https://wwdemo11.sharepoint.com/teams/HR-hejaheja2/_layouts/15/start.aspx#/ is where my webparts is. I’m not sure if I miss some part of the url or not?

    Thanks,
    Amanda – SharePoint rookie

    • Anatoly Mironov 2015-03-25 at 16:12

      Hi Amanda, the “pageurl” parameter is wrong. It points to the start.aspx which is an application page that is used for MDS. You should the real page url. You can see after the “#”. if it is too confusing, you could temporarily deactivate the MDS (Minimal Download Strategy) feature on the current web.

  4. derek gusoff 2015-06-25 at 22:10

    This is brilliant! Thanks for sharing this!

  5. Dan Walker 2015-08-15 at 11:00

    If you have a modern browser with developer tools IE, Chrome etc, you can just edit the html in place in the webpart and change allowexport to true [allowexport=”true”] while in editmode and it will then be able to be exported as usual from the webpart dropdown menu.

  6. Pingback: Export Any Web Part using a Bookmarklet - Bool Tech

  7. Pingback: Export Any SharePoint WebPart In a Click With This Bookmarklet or JavaScript : MIKE MORAWSKI | Programming & Tech Blog

  8. Apprentice 2016-02-25 at 05:37

    Dude, this is just the thing I was looking for, great post!

  9. carlintveld 2016-03-22 at 19:03

    Nice! Any way to export the audience targeting info as well?

    • Anatoly Mironov 2016-03-27 at 19:47

      Hi, The Target Audience is not a part of an “exportable” webpart definition. The Target Audience is saved on a particular webpart instance on a particular page.

  10. BInu 2016-08-30 at 16:13

    Hi, when i add to other site under same site collection, it is not working (List does not exists! error). How to fix this

  11. binuthazheveetil 2016-08-30 at 16:14

    Hi, when i added to another site (same site collection) – this is not working (list does not exists! error) – is there a fix for that?

    • Ben 2017-03-27 at 16:40

      Me, too! Help:)! List does not exist! Any ideas? Getting the same thing when use SPD and Export to Site Gallery, even when telling it to retain absolute not relative path to list/site.

  12. Fred 2017-03-24 at 15:52

    I encounter the same error like binu: List doesn’t exist.

    I’ve downloaded the file with your bookmarklet. But maybe I used the bookmarklet on the wrong site, to get the webpart?

    Thanks in advance!

    • Filippo Bertuzzi 2017-06-12 at 14:35

      You need to edit the .webpart with notepad and edit the WebId parameter, you will see is set as “00000000-0000-0000-0000-000000000000”

      To get the Id, use powershell
      Get-SPSite http://| Get-SPWeb -Limit All | Select Title, ID > C:\ListId.txt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Вула Чăвашла

VulaCV - Чăвашла вулаттаракан сайт

Discovering SharePoint

And going crazy doing it

Bram de Jager talking Office 365, SharePoint and Azure

My view and thoughts on Productivity and more.

My programming life

and everything in between

SharePoint Development Lab by @avishnyakov

It is a good place to share some SharePoint stories and development practices.

SharePoint Dragons

Nikander & Margriet on SharePoint

RealActivity - Real-time and trustworthy

Blog site of founder, RealActivty - Paul J. Swider

Mai Omar Desouki - Avid SharePointer

Egyptian & Vodafoner - Senior SharePoint Consultant

Cameron Dwyer | Office 365, SharePoint, Outlook, OnePlace Solutions

Office 365, SharePoint, OnePlace Solutions & Life's Other Little Wonders

paul.tavares

Me and My doings!

Share SharePoint Points!!

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

SPJoel

SharePoint for everyone

SharePointRyan

Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode, ya mama

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint

%d bloggers like this: