Submit existing form fields to a sharepoint list - InfoPath Dev Sign in | Join | Help in SharePoint Integration InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » SharePoint Integration » Submit existing form fields to a sharepoint list Submit existing form fields to a sharepoint list Last post 04-27-2014 05:32 PM by donstephen. 19 replies. Page 1 of 2 (20 items) 1 2 Next > Sort Posts: Oldest to newest Newest to oldest Previous Next 03-15-2014 03:37 AM york31 Joined on 01-08-2014 Posts 23 Submit existing form fields to a sharepoint list Reply Contact Hi,I have successfully followed some recipes for submitting data from a form into a list (e.g. the vintage http://www.infopathdev.com/blogs/matt/archive/2006/02/02/Add-SharePoint-List-Items-with-InfoPath.aspx). This involves using the "UpdateListItems method" and a CAML template.BUT... These recipes rely on a repeating table that need to be manually filled up by the user.I need to populate the target sharepoint list with data which already exists in the submitting form, without requiring the user to do anything. I cannot copy these fields to the target form fields as they are not visible at design time.Anybody knows how this is done? I would naturally prefer, if possible, an infopath 'native' solution, with no code or external sofwareIf involved.Thx,YK Filed under: UpdateListItems "Submit to list" 03-17-2014 09:24 PM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact Hi YKAre you attempting to update existing items in SharePoint? If so, you would need to change the command to Update instead of New, similar to the XML below:<?xml version="1.0" encoding="UTF-8"?><Batch OnError="Continue"> <Method ID="1" Cmd="Update"> <Field Name='Title'></Field> <Field Name="FirstName"></Field> <Field Name="Email"></Field> <Field Name="WorkPhone"></Field> </Method></Batch>Another thing you should consider is querying the items before updating them so that the IDs are determined instead of creating the item's IDs when submitting them.Please let me know if we're on the same page here. Don Stephen Lambatin / Support Engineer Qdabra Software 03-18-2014 02:03 AM In reply to york31 Joined on 01-08-2014 Posts 23 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact Hi donstephen,Thanks for your attention. I may not have been clear in explaining my problem.For clarity, I'll call the the form I am trying to design and the sharepoint list behind it the "Source" (form, list and item), and the sharepoint list I am trying to add to - the "Target".I want to open a new item in the Target list, so the "New" command is OK for me and works fine.The problem is that I want to populate the fields in the new Target item with fields already available in the Source form/item (in this example the values of "FirstName", "Email", etc., already exist in the Source form and just need to be copied to the Target).The method I used, relies on a repeating table that opens up for a user to fill up, which is exactly what I want to avoid. I want to create a new item in the Target list, containing the fields I choose to save there and with no user intervention.With this method, I do not seem to have a possibility of using a 'Set a field's value' action rule to populate the Target fields. They are defined in a CAML schema, which I do not seem to be able to access when I design the Source form. I hope I have done now a better job at explaining the issue.Thx,YK 03-18-2014 04:22 AM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact I see. So the issue here is not really on the submit part, but rather copying data from one repeating table to another, is this correct? If so, here is an MSDN link which discusses how to copy repeating data using code. Or you may want to use qRules if you wish for a codeless approach. Hope this helps. Don Stephen Lambatin / Support Engineer Qdabra Software 03-18-2014 12:57 PM In reply to york31 Joined on 01-08-2014 Posts 23 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact Well, not exactly...There is no repeating table in the Source form, just fields. I used a repeating table with CAML because that was the only example I found on the web... It worked fine, but this is not what I need.I need to create a new Target item and populate its fields with values from the fields in the Source form. Any idea how to do that? YK 03-25-2014 06:01 AM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact Hi YK,Sorry for not being able to get back to you soon. I'm not quite sure on how your form is set up, but if you are copying non-repeating data, a simple set value should do the trick. Would you be able to attach a sample of your form? Thanks. Don Stephen Lambatin / Support Engineer Qdabra Software 03-25-2014 12:55 PM In reply to york31 Joined on 01-08-2014 Posts 23 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact Hi,The problem is very basic, abdyou can easily recreate it. 1. Create a list called "Members" with two fields - "Name" & "Age".2. Create another list called "Change History" with identical fields.3. Create a record - {"John" "23"} in the "Members" list4. Now, using the form, update Jonh's age to "24"What I want to happen, is to have a new record automatically created in the "Change History" list, with the data {"John" "24" }. (As a new record it will have a "Created" and "Created By" fields which I can use it to track the history of changes to "Members").I hope this clarifies the issue.Thx,YK 03-30-2014 08:46 PM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact I see. So what you are attempting to do is copy the queried data onto the canvas and edit the items, is that correct? if so, then I think that it would be easier if you edited the queried data and then re-submit it to SharePoint. Is this not possible on your form? Don Stephen Lambatin / Support Engineer Qdabra Software 03-31-2014 01:17 PM In reply to york31 Joined on 01-08-2014 Posts 23 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact I am not sure I follow. I do not want to edit or query anything.I just want to cause two existing fields in my list/form to be written to another list. That is all... 03-31-2014 06:42 PM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact I'm quite baffled as well, since there is a list called "Members", wouldn't that be from SharePoint? Also, since we're not on the same page yet, would it be possible for you to attach a sample? I would greatly appreciate that. Thanks Don Stephen Lambatin / Support Engineer Qdabra Software 04-01-2014 09:07 PM In reply to york31 Joined on 01-08-2014 Posts 23 Re: Submit existing form fields to a sharepoint list Members.xsn Mark as Not AnswerMark as Answer... Reply Contact OK. There are two separate custom sharepoint lists "Members" and "History", both having similar fields - "Name" and "Age". Find attached the infopath form for the "Members" I want every change in a the "Members" list (Creating a new record or updating an existing one), to be recorded by creating a new record in"History" Scenario: We start with two empty lists. 1. Use the "Members" form to create a new record {"John", "23"} in the "Members" list and save it. ==> Required result: Once {"John", "23"} is saved to "Members", a new record {"John", "23"} is created in the "History" list 2. Use the "Members" form to edit its (single) record. Chage it from {"John", "23"} to {"John", "24"} ==> Required result:Once {"John", "24"} is saved to "Members", a new record with {"John", "24"} is created in the "History" list At the end of this scenario: "Members" has one record - {"John", "23"} "History" has two records - {"John", "23"} , {"John", "24"} I hope this is clearer now. Thx for your patience. YK 04-03-2014 12:18 AM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Submit existing form fields to a sharepoint list Members - Don.xsn Mark as Not AnswerMark as Answer... Reply Contact Thank you for sending over your form. Now I see that the form you are using is a customized form. Please check this sample I am attaching for your reference. You will see that there are two buttons, one is for submitting a new entry, and the other for updating an existing data. You will also notice a FormLogic which I used for the loop approach when submitting data. And also a drop down for selecting which item to update. Hope this helps.Regards, Don Stephen Lambatin / Support Engineer Qdabra Software 04-03-2014 02:51 PM In reply to york31 Joined on 01-08-2014 Posts 23 Re: Submit existing form fields to a sharepoint list ErrorMsg.jpg Mark as Not AnswerMark as Answer... Reply Contact Thanks Don, but the form you sent seems to be tied up to your specific server.I am getting the attached error message.I tried to use 'manage data connections" to change the address to my lists.asmx, but it does not help.Any idea how to work around it?Or just send me (or direct me) to an explanation of what the process is?Regards,YK 04-04-2014 06:09 AM In reply to donstephen Joined on 05-19-2013 Posts 623 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact Hi YK,Since the form you sent me did not have any CAML logic into it, I wasn't able to figure out what isn't working for you, so instead I created a form which is linked to the server I am using. There's not much difference between submitting and updating, except for chaging the Cmd at the CAML mapping to Update, and having a drop down at the top for selecting which data to update. If you check on the drop-down rule, you will see that the ID is being declared so that the form knows which item is being updated, after the ID has been selected, it then queries the data.Regards, Don Stephen Lambatin / Support Engineer Qdabra Software 04-08-2014 03:28 PM In reply to york31 Joined on 01-08-2014 Posts 23 Re: Submit existing form fields to a sharepoint list Mark as Not AnswerMark as Answer... Reply Contact Hi Don,I cannot run the form on my side, so I am trying to understand the logic.It seems to me that the "Select" field is for getting the ID of an existing record. In my case I ALWAYS want to create a new record so I guess it is not relevant.I assume the "Submit New" button in your example is the one I need to use, to have "Name" and "Age" submitted to an external list.I can see that all "Submit New" is doing is use Formlogic to submit. What is FormLogic? Is it a system service? Is it an XML you wrote? Can I see it?It seems that "Submit New" is not using CAMLmapping (which I asume describes the external list to write to - can I see it?). How come?I also find it strange that there is no need to give the list-ID of the target list to write to. And I still wonder if I managed to explain what I need, which is: Whenever I save a form to List A, a new record should be added to List B containing all or some of the data which went into A.Regards,YK Page 1 of 2 (20 items) 1 2 Next > Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Hi,
I have successfully followed some recipes for submitting data from a form into a list (e.g. the vintage http://www.infopathdev.com/blogs/matt/archive/2006/02/02/Add-SharePoint-List-Items-with-InfoPath.aspx).
This involves using the "UpdateListItems method" and a CAML template.
BUT... These recipes rely on a repeating table that need to be manually filled up by the user.
I need to populate the target sharepoint list with data which already exists in the submitting form, without requiring the user to do anything.
I cannot copy these fields to the target form fields as they are not visible at design time.
Anybody knows how this is done?
I would naturally prefer, if possible, an infopath 'native' solution, with no code or external sofwareIf involved.
Thx,
YK
Hi YK
Are you attempting to update existing items in SharePoint? If so, you would need to change the command to Update instead of New, similar to the XML below:
<?xml version="1.0" encoding="UTF-8"?><Batch OnError="Continue"> <Method ID="1" Cmd="Update"> <Field Name='Title'></Field> <Field Name="FirstName"></Field> <Field Name="Email"></Field> <Field Name="WorkPhone"></Field> </Method></Batch>
Another thing you should consider is querying the items before updating them so that the IDs are determined instead of creating the item's IDs when submitting them.
Please let me know if we're on the same page here.
Hi donstephen,
Thanks for your attention. I may not have been clear in explaining my problem.
For clarity, I'll call the the form I am trying to design and the sharepoint list behind it the "Source" (form, list and item), and the sharepoint list I am trying to add to - the "Target".
I want to open a new item in the Target list, so the "New" command is OK for me and works fine.
The problem is that I want to populate the fields in the new Target item with fields already available in the Source form/item (in this example the values of "FirstName", "Email", etc., already exist in the Source form and just need to be copied to the Target).
The method I used, relies on a repeating table that opens up for a user to fill up, which is exactly what I want to avoid. I want to create a new item in the Target list, containing the fields I choose to save there and with no user intervention.
With this method, I do not seem to have a possibility of using a 'Set a field's value' action rule to populate the Target fields. They are defined in a CAML schema, which I do not seem to be able to access when I design the Source form.
I hope I have done now a better job at explaining the issue.
Well, not exactly...
There is no repeating table in the Source form, just fields.
I used a repeating table with CAML because that was the only example I found on the web... It worked fine, but this is not what I need.
I need to create a new Target item and populate its fields with values from the fields in the Source form. Any idea how to do that?
Hi YK,
Sorry for not being able to get back to you soon. I'm not quite sure on how your form is set up, but if you are copying non-repeating data, a simple set value should do the trick. Would you be able to attach a sample of your form? Thanks.
The problem is very basic, abdyou can easily recreate it.
1. Create a list called "Members" with two fields - "Name" & "Age".
2. Create another list called "Change History" with identical fields.
3. Create a record - {"John" "23"} in the "Members" list
4. Now, using the form, update Jonh's age to "24"
What I want to happen, is to have a new record automatically created in the "Change History" list, with the data {"John" "24" }.
(As a new record it will have a "Created" and "Created By" fields which I can use it to track the history of changes to "Members").
I hope this clarifies the issue.
I am not sure I follow. I do not want to edit or query anything.
I just want to cause two existing fields in my list/form to be written to another list. That is all...
OK.
There are two separate custom sharepoint lists "Members" and "History", both having similar fields - "Name" and "Age". Find attached the infopath form for the "Members"
I want every change in a the "Members" list (Creating a new record or updating an existing one), to be recorded by creating a new record in"History"
Scenario:
We start with two empty lists.
1. Use the "Members" form to create a new record {"John", "23"} in the "Members" list and save it.
==> Required result: Once {"John", "23"} is saved to "Members", a new record {"John", "23"} is created in the "History" list
2. Use the "Members" form to edit its (single) record. Chage it from {"John", "23"} to {"John", "24"}
==> Required result:Once {"John", "24"} is saved to "Members", a new record with {"John", "24"} is created in the "History" list
At the end of this scenario:
I hope this is clearer now.
Thx for your patience.
Thank you for sending over your form. Now I see that the form you are using is a customized form. Please check this sample I am attaching for your reference. You will see that there are two buttons, one is for submitting a new entry, and the other for updating an existing data. You will also notice a FormLogic which I used for the loop approach when submitting data. And also a drop down for selecting which item to update. Hope this helps.
Regards,
Thanks Don, but the form you sent seems to be tied up to your specific server.
I am getting the attached error message.
I tried to use 'manage data connections" to change the address to my lists.asmx, but it does not help.
Any idea how to work around it?
Or just send me (or direct me) to an explanation of what the process is?
Since the form you sent me did not have any CAML logic into it, I wasn't able to figure out what isn't working for you, so instead I created a form which is linked to the server I am using. There's not much difference between submitting and updating, except for chaging the Cmd at the CAML mapping to Update, and having a drop down at the top for selecting which data to update. If you check on the drop-down rule, you will see that the ID is being declared so that the form knows which item is being updated, after the ID has been selected, it then queries the data.Regards,
Hi Don,
I cannot run the form on my side, so I am trying to understand the logic.
It seems to me that the "Select" field is for getting the ID of an existing record. In my case I ALWAYS want to create a new record so I guess it is not relevant.
I assume the "Submit New" button in your example is the one I need to use, to have "Name" and "Age" submitted to an external list.
I can see that all "Submit New" is doing is use Formlogic to submit. What is FormLogic? Is it a system service? Is it an XML you wrote? Can I see it?
It seems that "Submit New" is not using CAMLmapping (which I asume describes the external list to write to - can I see it?). How come?
I also find it strange that there is no need to give the list-ID of the target list to write to.
And I still wonder if I managed to explain what I need, which is: Whenever I save a form to List A, a new record should be added to List B containing all or some of the data which went into A.