Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

Exporting a survey to Excel programmatically

$
0
0

We have the need to export the contents of a survey on a regular basis to excel so it can be analysed and also stored for historical reasons.  Is there a way to export the contents of a survey using PowerShell/VB/C to an Excel file?  Once we've exported the results, we then need to delete all responses.  One of our surveys builds up to 3000 responses in less than a month, hence the need to do this via a script.

I have had a good look around and have tried the export-csv command,  unfortunately this doesn't export the responses, just a whole load of nothing, using an * in place of a field name just exports a load of rubbish.  I know a survey is essentially a list, however the normal export commands do not seem to work in the case of a survey.

$myweb = get-spweb "http://<servername>/system"
$mylist = $myweb.Lists["Survey1"]
$myitems = $mylist.items
$myitems | Select * | export-csv "C:\temp\survey1.csv"

Thanks.


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>