Webpart To view all documents of a user in MySite

Copper Contributor

Hi all,


Good Day!!


I have a requirement to create a webpart in Mysite Home page to display all documents that is modified by the user from all the sites where he has access.


This webpart has to be added in every users MySite page to view their documents.


Can someone help me resolve this issue.


9 Replies

Hi @Anisha Ashokan, what version of SharePoint are you deploying this to?


Also, what is your definition of documents which have been modified by a user? Does this mean where they were the last person to modify a document? The person who created a document? Or that they've modified the document at some point in its version history?

Hi @Matt Weston
I am using SharePoint 2013.
Regarding the definition of the document is to get the documents if that user has last modified the document. Not required to fetch if it's modified in the version history.

Thank you for the clarification. I'm a massive fan of search, especially for these types of requirements. You just need to remember that you'll need to wait for search to crawl the content before it appears.


On your page, you can add (assuming you've got SP2013 Enterprise) a Content Search web part (This can be found in your web part toolbox, under the Content Rollup category), or a Search Results web part (found under the Search Category once you have activated the Search Server Web Parts Site Collection Feature).


Edit your chosen web part and select "Change Query".

As you want to display content from anywhere within SharePoint, you can remove the path query, unless you're indexing data sources from outside of SharePoint as well. 


Change you query to look like this:

(IsDocument:"True") EditorOWSUSER:{User.Name}


IsDocument:"True" will remove list items from your results and only show documents (this includes aspx pages)

EditorOWSUSER:{User.Name} will match the modified by field to the user who runs the query (the logged in user)


If you want to filter your query down even more you could add the following to specify file types:

(FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:ppt OR FileExtension:pptx OR FileExtension:pdf)


As long as the user has permissions to the content source, they will see their documents in the results.



Thank you for your response. 

This looks great.


How can I implement the same to appear in every users MySite page so that each user can see there documents in their mysite?



best response confirmed by Anisha Ashokan (Copper Contributor)

The simplest approach would be to navigate to your MySite, bring up the news feed page and edit the through the user interface. You'll see the web part zones which you can add the web part to. The page which has the news feed is a common page which is provided by the MySite host, therefore you can edit it in one place and all users will see search results which are contextual to them (See my screenshot).

Hi ,


I dont see an option to edit page in the My site news feed page to add the webparts.  Can you please help me as to where this option would be present.

Please see my screenshot.



Your user doesn't have the correct permissions to do that on the MySite host. I'm a site collection admin on that site, so you'll either need to temporarily increase your privileges or ask an admin to do it on your behalf.

Thank you so much for your help.

My issue is resolved. I did not have required permissions. 

Hi Matt Weston


Can we get the Sites that I'm Following using Search Results Webpart?


Thanks for the help.