Posts

Showing posts from 2018

Export SharePoint Search Content to CSV

This came as a client requirement and made me scratch my head for days. The requirement was that the client would perform a search, apply refiners, change sort order etc. and we needed to export the result that is being displayed to the user. In rest api, we have an end point for search which accepts QueryText and Refiners and returns search result which we can write to the CSV file. But the real challenge is to transform all the operations that are done by the user on the search page to the acceptable parameters of rest api. As you might have noticed when you perform the search, whatever operation you perform, the parameters are added to the query string and a request is sent to the server. So we can read the parameters from the query string and create rest api specific parameters.  So we will be converting https://*****.sharepoint.com/sites/Search/Pages/search.aspx?k=test#Default={"k":"test","r":[{"n":"RefinableString15",...