<?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>Data Connections</title><link>https://www.infopathdev.com:443/forums/44.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>[InfoPath 2010] Copy data from secondary data connection into the main form fields</title><link>https://www.infopathdev.com:443/forums/thread/93627.aspx</link><pubDate>Fri, 11 Oct 2013 08:07:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:93627</guid><dc:creator>dwats</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/93627.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=93627</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;Goal&lt;/strong&gt;: Pull data from a SharePoint 2010 List using a WEB ENABLED form. Then, from the repeating table that contains the secondary data, extract only the desired data and mirror it in my main form fields. The extracted data would then be modified, and submitted to another sharepoint list using Nintex Workflows or, if the IT department smiles upon this project, a database.&lt;/p&gt;
&lt;p&gt;Original post on Stack Overflow: &lt;a title="StackOverflow Posting" href="http://stackoverflow.com/q/19296786/653479" target="_blank"&gt;http://stackoverflow.com/q/19296786/653479&lt;/a&gt;&lt;/p&gt;


&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;What I&amp;#39;ve Tried&lt;/strong&gt;: Created a field, named &amp;quot;TEST_CyS&amp;quot;, in a repeating group, named &amp;quot;TEST&amp;quot;, in my main form fields to store the mirrored data. This field has a default value of:&lt;/p&gt;

&lt;p style="font-family:monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xdXDocument:GetDOM(&amp;quot;REMOVED&amp;quot;)/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[(count(../preceding-sibling::*[local-name() = &amp;quot;TEST&amp;quot;]) + 1)]/d:Cy_Statement&lt;/p&gt;

&lt;p&gt;This is refreshed when the form updates.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If I set the default value to &lt;span style="font-family:monospace;"&gt;count(../preceding-sibling::*[local-name() = &amp;quot;TEST&amp;quot;]) + 1 &lt;/span&gt;it accurately counts each inserted group.&lt;/li&gt;

&lt;li&gt;If I set the default value to &lt;span style="font-family:monospace;"&gt; xdXDocument:GetDOM(&amp;quot;REMOVED&amp;quot;)/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[&amp;lt;INT&amp;gt;])]/d:Cy_Statement &lt;/span&gt; where `&amp;lt;INT&amp;gt;` is any whole value between 1 and n then the field will display the correct information, for the secondary data field whose index is referenced.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It&amp;#39;s when I combine the two that things fall apart.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Main Data Tree:&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img style="width:267px;height:184px;" align="left" src="http://i.stack.imgur.com/ww6WG.png" width="267" height="184" alt="" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Secondary Data Tree:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img style="width:265px;height:242px;" src="http://i.stack.imgur.com/wo9av.png" width="265" height="242" alt="" /&gt;&lt;/p&gt;
&lt;strong&gt;

&lt;hr /&gt;
&lt;/strong&gt;
&lt;p&gt;&lt;strong&gt;Assumptions:&lt;/strong&gt; I am guessing that the &lt;span style="font-family:monospace;"&gt; preceding-sibling::*[local-name() = &amp;quot;TEST&amp;quot;] &lt;/span&gt;axis is not returning a value due to the fact that it&amp;#39;s being called along with the &lt;span style="font-family:monospace;"&gt; GetDOM()&lt;/span&gt; method. I&amp;#39;ve tried to point the preceding-sibling back to the correct group in the Main form fields, but then I felt silly for trying that as it wouldn&amp;#39;t know where to start counting AND infopath presented me with an error: &lt;/p&gt;

&lt;p&gt;&lt;span style="font-family:monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Function &amp;#39;GetDOM&amp;#39; did not return a value, or it returned a value that cannot be converted to an XSL data type.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Information: &lt;/strong&gt;I don&amp;#39;t have access to VSTA or any third party &amp;quot;plugins&amp;quot;. The IT department has the systems locked down so I am working with quite a few barriers. I&amp;#39;d like to create an elegant solution for this project and I know it would be easier if I could use code, but I can&amp;#39;t&amp;nbsp;and might not ever be able to on this project.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Is there an alternative method I could use to pull this off or is it a lost cause? &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m okay with it being a lost cause for right now as it might light some tiny fires under the right managers to press IT. For now I&amp;#39;ll be working around this problem by making a less than ideal solution, but I&amp;#39;d like to keep looking at a solution if one might exist.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item></channel></rss>