<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Execute query for each row in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/82696.aspx</link><pubDate>Fri, 14 Sep 2012 21:41:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:82696</guid><dc:creator>jeffkinzer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/82696.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=82696</wfw:commentRss><description>Really good information, thanks!!</description></item><item><title>Re: Execute query for each row in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/81581.aspx</link><pubDate>Fri, 10 Aug 2012 20:30:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:81581</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/81581.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=81581</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;SteveJones:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Without knowing how many people have&amp;nbsp;read this question I don&amp;#39;t know whether or not this information is useful to others.&amp;nbsp;Would it be possible to put a view count on the thread like the reply count?&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I support &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks! &lt;/p&gt;&lt;p&gt;Pity I missed this thread before&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Execute query for each row in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/81190.aspx</link><pubDate>Tue, 31 Jul 2012 19:38:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:81190</guid><dc:creator>SteveJones</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/81190.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=81190</wfw:commentRss><description>&lt;p&gt;Without knowing how many people have&amp;nbsp;read this question I don&amp;#39;t know whether or not this information is useful to others.&amp;nbsp;Would it be possible to put a view count on the thread like the reply count?&lt;/p&gt;
&lt;p&gt;Anyway, I finally figured out how to execute a rule for each row in a repeating table and thought I&amp;#39;d post the answer in case anyone else is interested. &lt;/p&gt;
&lt;p&gt;I created an integer field idx to use as the position of the repeating row, and to that field I added a rule with the above&amp;nbsp;listed actions to set the values of the web service and execute it. I figured that I&amp;#39;d set the value of idx to 1, use it to get the right set of person values, increment idx and do it again until idx &amp;gt; count(Person). But it was a bit tricky getting the value of idx to re-evaluate each time. 
&lt;p&gt;In the place of &amp;quot;&lt;strong&gt;position() = 1&lt;/strong&gt;&amp;quot; in the rule actions&amp;nbsp;above I used &amp;quot;&lt;strong&gt;number(../../my:gpFormVariables/my:idx)&lt;/strong&gt;&amp;quot;. You must use number(), and put the full relative path of idx in it to get it to reevaluate each time. Just choose Person/DisplayName, check Edit XPath, then type&amp;nbsp;&lt;strong&gt;&amp;quot;[number(full relative xpath to your index field)]&amp;quot;&lt;/strong&gt; right after Person and before /. 
&lt;blockquote&gt;
&lt;p&gt;set a fields value: groupName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = concat(DocLibrary, &amp;quot; Read&amp;quot;)&lt;br /&gt;set a fields value: userName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;Person[number(../../my:gpFormVariables/my:idx)]/pc:DisplayName&lt;br /&gt;set a fields value: userLoginName = Person[number(../../my:gpFormVariables/my:idx)]/pc:AccountId&lt;br /&gt;query using a data connection:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddUserToGroup&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I added another action to increment idx:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;set a fields value: idx = idx + 1&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;and then added&amp;nbsp;a condition to the rule so that it would only execute for the number of rows in the repeating table:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;idx &amp;lt;= count(../../my:gpApprovers/pc:Person)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Then I added a rule to my&amp;nbsp;&amp;#39;submit&amp;#39; button:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;set a fields value: idx = 1&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Works like a champ, but is subject to the rule of 16 ... it would not run more than 16 times because of Infopath&amp;#39;s built in rule to prevent infinite loops.&lt;/p&gt;</description></item><item><title>Execute query for each row in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/81071.aspx</link><pubDate>Fri, 27 Jul 2012 12:18:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:81071</guid><dc:creator>SteveJones</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/81071.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=81071</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve got a people picker on my form that may have several people added to it. &lt;/p&gt;
&lt;p&gt;When the user submits the form I want to execute a data connection query for each row in that people picker schema, and I want to do it using rules only ... no code.&lt;/p&gt;
&lt;p&gt;Details:&lt;/p&gt;
&lt;p&gt;The purpose of my form is to route a document for approvals and training (which consists of reading the document and acknowledging that you have read it). Upon submission it will create a folder in one of 4 sharepoint document libraries selected from a drop down box and the document is placed in that folder. These libraries have restricted access and have associated&amp;nbsp;Sharepoint groups (&amp;quot;libraryname&amp;nbsp;Read&amp;quot;), and I want to be able to add each person selected in the two people pickers to the library&amp;#39;s Read group. I can do this easily with Sharepoint&amp;#39;s UserGroup.asmx web service by setting the group name, user name, and user ID and executing the web service. It works fine&amp;nbsp;for a single person selected, but how&amp;nbsp;can I iterate thru each person and execute the data connection?&lt;/p&gt;
&lt;p&gt;Added More Details:&lt;/p&gt;
&lt;p&gt;My data connection is a &amp;#39;receive&amp;#39; connection so that I can set the queryfields. It is linked to &lt;a href="http://%3csharepoint%20site%20path%3e/_vti_bin/usergroup.asmx"&gt;http://&amp;lt;sharepoint site path&amp;gt;/_vti_bin/usergroup.asmx&lt;/a&gt;, and is named AddUserToGroup&lt;/p&gt;
&lt;p&gt;My complete rule is: &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;set a field&amp;#39;s value: AddUserToGroup/groupName = concat(DocLibrary, &amp;quot; Read&amp;quot;)&amp;nbsp; &lt;font color="green"&gt;&amp;#39;... specify the sharepoint group name&lt;/font&gt; &lt;br /&gt;set a field&amp;#39;s value: AddUserToGroup/userName = Person[position() = 1]/DisplayName &lt;br /&gt;set a field&amp;#39;s value: AddUserToGroup/userLoginName = Person[position() = 1]/AccountId &lt;br /&gt;Query using a data connection: AddUserToGroup&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So now I just need to figure out how to iterate thru the rule for each person. Any ideas?&lt;/p&gt;</description></item></channel></rss>