<?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>Iterate through Sharepoint List</title><link>https://www.infopathdev.com:443/forums/thread/95182.aspx</link><pubDate>Mon, 13 Jan 2014 18:13:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:95182</guid><dc:creator>majestek12</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/95182.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=95182</wfw:commentRss><description>&lt;p&gt;First off - TIA for any support!! I&amp;#39;m fairly new to InfoPath and to this forum; I&amp;#39;ve done alot of reading here and the forums have answered many of my questions and provided me with alot of education.&lt;/p&gt;&lt;p&gt;I have an Infopath 2010 form that I am using to collect information for a process improvement suggestion. The form contains multiple checboxes, each one for a department.&lt;/p&gt;&lt;p&gt;Seperately from the form I have a SP list that contains managers, their&amp;nbsp;address,&amp;nbsp;and the department they are responsible for. Each department may have multiple managers with delegated responsibility. IE:&lt;br /&gt;- John Smith : &lt;a href="mailto:jsmith@company.com"&gt;jsmith@company.com&lt;/a&gt;&amp;nbsp;: Department 1, Department 2&lt;br /&gt;- Jane Doe :&amp;nbsp;&lt;a href="mailto:jdoe@company.com"&gt;jdoe@company.com&lt;/a&gt; : Department 1&lt;br /&gt;- Bob Smith : &lt;a href="mailto:bsmith@company.com"&gt;bsmith@company.com&lt;/a&gt; : Department 1, Department 3, Department 4.&lt;/p&gt;&lt;p&gt;Inside the form I have a data connection that pulls the necessary fields from the list.&lt;/p&gt;&lt;p&gt;What I would like the form to do is to iterate through the Sharepoint list, return all of the emails for the &amp;quot;checked&amp;quot; department, and concatenate them into a text box. IE:&lt;br /&gt;- Form User checks the box for Department 1&lt;br /&gt;- &lt;a href="mailto:jsmith@company.com"&gt;jsmith@company.com&lt;/a&gt;; &lt;a href="mailto:jdoe@company.com"&gt;jdoe@company.com&lt;/a&gt;; &lt;a href="mailto:bsmith@company.com"&gt;bsmith@company.com&lt;/a&gt; is populated into a text box. I then use the string in this text box to populate the &amp;quot;To&amp;quot; field on and email data connection when the form is submitted.&lt;/p&gt;&lt;p&gt;So far I&amp;#39;ve been pulling my hair out and the closest I can get is by using the double-eval trick. This correctly counts/iterates through the number of managers on the list who are responsible for the selected department but the data connection only returns the first email address, 3 times.&lt;/p&gt;&lt;p&gt;Code:&lt;br /&gt;eval(eval(Title[contains(Delegated_x0020_Departments, &amp;quot;Department 1&amp;quot;)], &amp;#39;concat(xdXDocument:GetDOM(&amp;quot;Admin Rights Query - OpEx Leadership List Check&amp;quot;)/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[contains(../d:Delegated_x0020_Departments, &amp;quot;Department 1&amp;quot;)], &amp;quot;; &amp;quot;)&amp;#39;), &amp;quot;..&amp;quot;)&lt;/p&gt;&lt;p&gt;What the code yields with the above example list:&lt;br /&gt;jsmith@company.com; jsmith@company.com; jsmith@company.com &lt;/p&gt;&lt;p&gt;It is apparent that the code is counting correctly, just not moving down the list from record to record. I realize that this is because I am using an absolute xPath expression instead of a relative one but I cannot get any relative syntax to work.&lt;/p&gt;&lt;p&gt;Unfortnuately my major limitation is that I cannot get access to run code behind or create a workflow. I realize I could set up a second list and have the departments be discrete with multiple email addresses but I&amp;#39;d highly prefer to keep&amp;nbsp;one list and it needs to be organized by the user.&amp;nbsp;Is there a way to codelessly obtain my goal?&lt;/p&gt;</description></item></channel></rss>