<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Secondary Data Source CAML Nodes not updating with "myFields" to SP Custom List</title><link>https://www.infopathdev.com:443/forums/thread/52841.aspx</link><pubDate>Wed, 17 Mar 2010 16:10:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52841</guid><dc:creator>gabriel_haukness</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52841.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=52841</wfw:commentRss><description>&lt;p&gt;Hi all, &lt;/p&gt;
&lt;p&gt;I am brand new to InfoPath but have had SP experience. I followed these two articles to update a custom SP List with values from my InfoPath forms fields:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infopathdev.com/forums/t/4055.aspx"&gt;http://www.infopathdev.com/forums/t/4055.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;&lt;font color="#800080"&gt;&lt;a href="http://blog-sharepoint.blogspot.com/2009/07/infopath-update-repeating-elementsnodes.html"&gt;http://blog-sharepoint.blogspot.com/2009/07/infopath-update-repeating-elementsnodes.html&lt;/a&gt;&lt;/font&gt;&lt;/u&gt;&lt;a href="http://blog-sharepoint.blogspot.com/2009/07/summary-how-to-programmatically-update.html"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I know the ListName GUID matches up as every time I hit submit a new item is created. But the item is blank because the CAML nodes are not being updated, even though after following the article in the 2nd link I get no errors. &lt;/p&gt;
&lt;p&gt;The CAML secondary receive data source:&lt;/p&gt;
&lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;Batch OnError=&amp;quot;Continue&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Method ID=&amp;quot;1&amp;quot; Cmd=&amp;quot;New&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=&amp;#39;Title&amp;#39;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name=&amp;quot;First_x002d_Name&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;Employee_x002d_ID&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;E_x002d_mail&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;Work_x002d_Phone&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;Job_x002d_Title&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;LOB&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;First_x002d_Choice&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;Second_x002d_Choice&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;Third_x002d_Choice&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Field Name=&amp;quot;Fourth_x002d_Choice&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;Field Name=&amp;quot;Unable_x002d_To_x002d_Attend&amp;quot;&amp;gt;&amp;lt;/Field&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/Method&amp;gt;&lt;br /&gt;&amp;lt;/Batch&amp;gt;&lt;br /&gt;&lt;br /&gt;All the fields were copy pasted from the SharePoint column GUID&amp;#39;s. In the same method all the myFields nodes&amp;nbsp;names were copy/ pasted from the CAML. The script that I am using is this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="style1" style="PADDING-RIGHT:10px;MARGIN-TOP:10px;PADDING-LEFT:10px;FONT-SIZE:10pt;MARGIN-BOTTOM:10px;PADDING-BOTTOM:10px;PADDING-TOP:10px;FONT-FAMILY:Courier,monospace;BACKGROUND-COLOR:#e4e4e4;"&gt;&lt;span style="COLOR:#006600;"&gt;//Select all nodes from the CAML XML Data Source - Declare outside of&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR:#006600;"&gt;//updateXMLDataSouce function, otherwise it will be set every time&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR:#006600;"&gt;//the function is called, which is once for each repeating element&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;var xmlDataSource = XDocument.GetDOM(&amp;quot;CAML_XMLt&amp;quot;);&lt;br /&gt;var UpdateXML = xmlDataSource.selectNodes(&amp;quot;/Batch/Method/Field&amp;quot;);&lt;br /&gt;&lt;br /&gt;function updateXMLDataSource(XMLFieldName, sourceField)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;var count;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR:#006600;"&gt;//Loop through each element in the data source to find the&lt;br /&gt;//required field in the CAML template&lt;/span&gt;&lt;br /&gt;for (count = 0; count « UpdateXML.length; count++)&lt;br /&gt;{&lt;br /&gt;&lt;span style="COLOR:#006600;"&gt;//Test if the name attribute of the current&lt;br /&gt;//element matches the required field&lt;/span&gt;&lt;br /&gt;if (UpdateXML[count].getAttribute(&amp;quot;Name&amp;quot;).localeCompare(XMLFieldName) == 0)&lt;br /&gt;{&lt;br /&gt;&lt;span style="COLOR:#006600;"&gt;//Element Found: Update the value of current&lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR:#006600;"&gt;//element to the value of souceField parameter (XPATH)&lt;/span&gt;&lt;br /&gt;var DSNode = XDocument.DOM.selectSingleNode(sourceField);&lt;br /&gt;UpdateXML[count].text = DSNode.text&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;
&lt;p&gt;I seem to be stuck here; the empty node CAML object is inserted to the SP List and myFields are not transferring using the above script. Even though all fields are identical. &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>