SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a SharePoint List with about 3000 items and in the same Site I also have a Document library with custom InfoPath Template. Since there are over 3000 items in the list I dont wast to manually create a form for each item and save it.

Is there a way I can write code in C# and Generate InfoPath files based on the values in the SP list?

share|improve this question
InfoPath forms stored in a document library are just xml files, tied to a content type that opens an InfoPath form to display the xml. You may want to spend some more time to get familiar with what InfoPath is and what it does. – teylyn Mar 29 '13 at 10:46

You do not need any code for this. Make data connection (source) to the sharepoint list in your template and use controls of your choice to visualize it

share|improve this answer

If you are using SharePoint 2010, you can customize the list forms using InfoPath. The below link might be informative for you.

In the above case, your data will be stored as it is and the UI will be opened in InfoPath.


First submit one item in your library using the content type, and see the xml. You can write a console application to read the items from list and generate the xml (should match exactly) for each list item and upload the same into the document library.

share|improve this answer
-1 The OP asked about Infopath library forms (not Sharepoint List Forms) getting data from sharepoint list as data source/connection (into Infopath library form). Your link is about customizing Sharepoint List Forms which do not have even XML data forms (as Infopath library forms do). This is completely irrelevant, redundant and misleading to the task of the question asked as well as there is no need to do any coding or applications to acomplish this – Gennady Vanin Геннадий Ванин Mar 30 '13 at 7:19
I have provided 2 options. Please have a look at them carefully. Vikram wants to convert those 3000 list items as InfoPath based items. My solution is not at all misleading. Please let me know if you have any queries. – BHUMI Apr 5 '13 at 5:44
Hi BHUMI, I am using the 2nd option your mentioned. thanks – Vikram Apr 12 '13 at 6:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.