<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Generating Filename</title><link>https://www.infopathdev.com:443/forums/thread/41086.aspx</link><pubDate>Wed, 29 Apr 2009 13:56:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41086</guid><dc:creator>klc2009</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41086.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=41086</wfw:commentRss><description>&lt;p&gt;string-length(&lt;em&gt;xpath of DocNum&lt;/em&gt;) = 2 &lt;/p&gt;
&lt;p&gt;Then if the DocNum had 2 digits&amp;nbsp;I would set the following value in the text field:&lt;/p&gt;
&lt;p&gt;concat(DocType,&amp;quot;-&amp;quot;,ISONum,&amp;quot;00-&amp;quot;,DocNum)&lt;/p&gt;
&lt;p&gt;If DocNum had 3 digits then I would set the same value, but with one zero less.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you very much, this worked perfectly!&lt;/p&gt;</description></item><item><title>Re: Generating Filename</title><link>https://www.infopathdev.com:443/forums/thread/41075.aspx</link><pubDate>Wed, 29 Apr 2009 06:12:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41075</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41075.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=41075</wfw:commentRss><description>&lt;p&gt;Check out the eval function.&lt;/p&gt;</description></item><item><title>Re: Generating Filename</title><link>https://www.infopathdev.com:443/forums/thread/41067.aspx</link><pubDate>Tue, 28 Apr 2009 21:18:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41067</guid><dc:creator>ocampod84</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41067.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=41067</wfw:commentRss><description>&lt;p&gt;You could try to compare the value being less than a specific amount, however, you would have to structure your rules in a way to avoid logic errors. For example, if you had three rules: if x is less than 100, if x is less than 10, etc., you would have to set the rules that work with higher numbers first. For example, 1 is less than 10, but it&amp;#39;s also less than 100, so which value would it receive? I prefer to use the string length, that way I know that 2 digits will always produce numbers between 10-99, three digits 100-999, etc. Sorry, if this is confusing!&lt;/p&gt;
&lt;p&gt;You&amp;#39;re right, infopath doesn&amp;#39;t have an &amp;quot;if-then&amp;quot; statement, but I created a simple expression that would handle this. I used the following expression as my condition:&lt;/p&gt;
&lt;p&gt;string-length(&lt;em&gt;xpath of DocNum&lt;/em&gt;) = 2 &lt;/p&gt;
&lt;p&gt;Then if the DocNum had 2 digits&amp;nbsp;I would set the following value in the text field:&lt;/p&gt;
&lt;p&gt;concat(DocType,&amp;quot;-&amp;quot;,ISONum,&amp;quot;00-&amp;quot;,DocNum)&lt;/p&gt;
&lt;p&gt;If DocNum had 3 digits then I would set the same value, but with one zero less.&lt;/p&gt;
&lt;p&gt;You would need three or so rules to get your results. I hope this makes sense!!&lt;/p&gt;</description></item><item><title>Re: Generating Filename</title><link>https://www.infopathdev.com:443/forums/thread/41064.aspx</link><pubDate>Tue, 28 Apr 2009 20:20:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41064</guid><dc:creator>klc2009</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41064.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=41064</wfw:commentRss><description>&lt;p&gt;Thank you for your feedback and it does make sense. However, if it&amp;#39;s possible to add an if statement to the button formula, I can&amp;#39;t figure out how to do it. :( I don&amp;#39;t think I need the length function, as I can just check if the value is less than 10, less than 100 etc, correct? But any syntax I try for an if statement is rejected.&lt;/p&gt;</description></item><item><title>Re: Generating Filename</title><link>https://www.infopathdev.com:443/forums/thread/41060.aspx</link><pubDate>Tue, 28 Apr 2009 19:27:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41060</guid><dc:creator>ocampod84</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41060.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=41060</wfw:commentRss><description>&lt;p&gt;As you may well know, the problem arises from those static zeros you have. A rule would make it more dynamic. For example, by taking the length of the DocNum, you can determine how many zeros you want. Something like, if length(DocNum) &amp;gt; 2 then use the following forumla concat(DocType,&amp;quot;-&amp;quot;,ISOFolderNum,&amp;quot;-00&amp;quot;,DocNum). Then if length(DocNum) &amp;gt; 3 then you would have another formula that would remove another zero.&lt;/p&gt;
&lt;p&gt;I hope this makes sense.&lt;/p&gt;</description></item><item><title>Generating Filename</title><link>https://www.infopathdev.com:443/forums/thread/41056.aspx</link><pubDate>Tue, 28 Apr 2009 17:19:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41056</guid><dc:creator>klc2009</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41056.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=41056</wfw:commentRss><description>&lt;p&gt;First let me say that I am a complete newbie to&amp;nbsp;InfoPath and that I am using it in combination with Sharepoint to design and implement&amp;nbsp;a document management strategy. I am not a&amp;nbsp;developer by any stretch, so would prefer not to attempt to use code&amp;nbsp;if possible. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using InfoPath 2007. I have a template part that I am building where I have a button to Generate Filename that uses this function:&lt;/p&gt;
&lt;p&gt;concat(DocType, &amp;quot;-&amp;quot;, ISOFolderNum, &amp;quot;-000&amp;quot;, DocNum)&lt;/p&gt;
&lt;p&gt;And this works fine until I get to larger DocNums, when&amp;nbsp;I want the number of 000s to change accordingly. For instance, since my first DocNum is 1, the filename generated now is WI-10-0001. But when I get to DocNum 10, the way it is set up now the filename will be WI-10-00010 but what I want it to&amp;nbsp;be is WI-10-0010. &lt;/p&gt;
&lt;p&gt;How can I accomplish this? Thanks in advance for any help.&lt;/p&gt;
&lt;p&gt;klc2009&lt;/p&gt;</description></item></channel></rss>