简体   繁体   中英

How to get data fields from existing form library to the new list in SharePoint

I have an InfoPath form template in SharePoint and that is for some Project setup form . In that I had a simple text field name "PO Number" that was being used in some other form library to receive project details including PO Number.

As per the requirement now one Project can have more than one "PO Number" so I changed the form design and code to make it functional following this link:

Submitting Data from InfoPath to a SharePoint List And I created a list MyPONumbers in SharePoint to save all the PO Numbers for different Projects.And it works fine when I enter a new record in Project setup form, it saves PONumber for that Project in MyPONumbers list.

But Initially MyPONumbers list is empty and I want to get all the (Past) PONumbers for different Projects already existing in my Project setup Library as those projects are still active.

Is there any automatic process or way to get the past(existing) form data field in the newly created list.

Please advise. Thank you.

Assuming that you have been publishing the form as a content type (not clear from your description) and the data fields are columns in the library where you're storing the forms, then you can write a simple code that reads data from the library and stores the mapping between the project and PO# in the list.

If they are not fields in the library, then you can also write some C# code to loop through all forms and get data (as XML) from them and store in the list. Something similar to : https://sujeewaediriweera.wordpress.com/2012/02/12/accessing-infopath-form-data-programmatically/

You could create a Workflow for the old form Library? To do this make it start on change then go ahead and create another column in that old library (not the form) and create a grid view so you can edit that new column and change it(you can change 1 field then grab the bottom right of that field and drag to all of the old rows) or copy another columns data then past it into that new column and this will create the change event and trigger the WF you create to Create List Item in your new List. Worked for me one time I had this issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM