<?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>max(@ID) based on field</title><link>https://www.infopathdev.com:443/forums/thread/56732.aspx</link><pubDate>Fri, 09 Jul 2010 20:53:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:56732</guid><dc:creator>esiege</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/56732.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=56732</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hello all,&lt;/p&gt;&lt;p&gt;I&amp;#39;m trying to do something that seems fairly simple, but have been hitting a dead end.&lt;/p&gt;&lt;p&gt;I&amp;#39;m using a data connection to retrieve a field that increments based on a sharepoint list called ID, and this works fine up to this point with the usual max(@ID)+1 for the value.&lt;/p&gt;&lt;p&gt;Now the tricky part I&amp;#39;m running into is I have a dropdown field to select some text called Area, when &amp;quot;Area A&amp;quot; is selected, the ID should only count &amp;quot;Area A&amp;quot; forms on the list.&lt;/p&gt;&lt;p&gt;So far I&amp;#39;ve set up a rule with conditions &amp;quot;AreaDrowndown(infopath field) = Area(from data connection)&amp;quot;, with the action of set field value &amp;quot;IDBox = max(@ID)+1&amp;quot;.&lt;/p&gt;&lt;p&gt;This obviously triggers the event at the right time, but then does a full count of all items with any Area.&lt;/p&gt;&lt;p&gt;I was thinking of adding a view as a data connection to filter the data to count, but can&amp;#39;t find a way to get this setup.&amp;nbsp; I was also hoping for something like an if statement for the max(@ID) function, but I can&amp;#39;t figure out the syntax for that either, it seems to revolve only around conditions.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks for hearing me out! :) &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>