0

Is it possible for to have 1 InfoPath form submit some elements to one SharePoint list and others to another SharePoint list?

For example..

1. first_name
2. last_name
3. age
4. interests (field repeated as many times as the user wants)

where first_name, last_name and age are saved to one SharePoint list and first_name, last_name and interests are saved to another SharePoint list.

Lets say a user has 3 interests that means list 1 has 1 entry with 'first_name, last_name and age' while list 2 has 3 entries with columns 'first_name, last_name and interests'.

Thank you!

1

I quit using InfoPath and learned how to use highly customized forms in SharePoint Designer for the same requirement you are trying to satisfy.

Using javascript you can use the default preSaveAction() function that SharePoint forms will use every time they are saved. Inside that function you would need to use jquery SPServices UpdatelistItems to make a New list item that gathers data from some custom HTML fields you put into the form and saves them in the list you want.

This is untested, and I wrote off the top of my head...

  // Add Jquery library
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script
  // Add SPServices Library
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices.min.js"></script

  function preSaveAction(){
   //get data from form fields
   var fname = $('#fname').val();
   var lname = $('#lname').val();
   var age = $('#age').val();

   //array to store data (field name in list, variable name)
   var valuepairs = [["first_name", fname], ["last_name", lname], ["age", age]];

   // This command will update the list using the valuepairs array
   $().SPServices({ 
      operation: "UpdateListItems", 
      async: false, 
      batchCmd: "New",
      listName: "TheOtherLISTName", 
      valuepairs: valuepairs
      completefunc: function(xData, Status) { 

      } 
   });


  }
1

I hope you are using InfoPath 2010 (as you havne't mentioned the version in your question) to submit data in multiple SharePoint list from single form.

So, You can't achieve this through OOB solution. You can only submit data to one single list.

Have a look at the following article, hope it helpful.

InfoPath 2010 and SharePoint 2010 – List Forms vs Library Forms

  • Is above information helps you? Did you get it or need more help on this? – Hardik Jun 29 '16 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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