Home > Forum > Actions > Add more than one list element to SharePoint list based on a multi-value form field.

Add more than one list element to SharePoint list based on a multi-value form field.
0

Hi,

We have a following scenario:
1) An user has a form field where he can choose mulitple values in one form field (lets say different persons)
2) Then the user submits the form and it goes to a SharePoint list. We'd like to add the same number of records to Sharepoint list as the number of values selected in the abovementioned form field. So each record should represent one person and have other form fields the same for all persons.

An example.
The user fills the form in:
1 form field: CAR: Volkswagen Golf IV
2 form field: Persons: Mr Smith, Mr Johnson, Mr Williams
3 form field: Position: Manager

Then the Sharepoint list should add the following rows:
1) Mr Smith // Volkswagen Golf IV // Manager
2) Mr Johnson // Volkswagen Golf IV // Manager
3) Mr Williams // Volkswagen Golf IV // Manager

Is it somehow possible?

MVP

Appart from not knowing why you still want to use SharePoint-Lists when you've got the WEBCON webparts, you could achieve it this way:
1. Use an itemlist with the fields car/person/manager as technical field and fill in the values based on the form values.
To fill the values you can use an sql statement and the function dbo.splittotable
e.g. SELECT item as Person, 'Volkswagen Golf IV' AS Car, 'Manager' as Position From dbo.SplittoTable('Mr Smith;Mr Johnson;Mr Williams;', ';'), where as you replace the text by the values of your from fields
2. Use the itemlist and the "start a subworkflow (SQL)" action to start helper workflows which then creates the listitem on sharepoint