<?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: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/4006.aspx</link><pubDate>Fri, 16 Feb 2007 18:54:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4006</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4006.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4006</wfw:commentRss><description>Glad to have helped out. Its the process of learning. It won't be long before you'll be answering everybody's questions about InfoPath!!</description></item><item><title>Re: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/4005.aspx</link><pubDate>Fri, 16 Feb 2007 15:21:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4005</guid><dc:creator>funniegrrl</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4005.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4005</wfw:commentRss><description>Genius!  Sheer genuius!  It works like a charm.  I had actually thought about trying that, but then assumed it would be unnecessary overkill.  That'll teach me!  heh heh&lt;br /&gt;&lt;br /&gt;Thanks, Greg, I really appreciate the help.  Saved the day!</description></item><item><title>Re: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/4004.aspx</link><pubDate>Thu, 15 Feb 2007 23:40:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4004</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4004.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4004</wfw:commentRss><description>Sounds like you are 99% of the way there. Have patience and hope!&lt;br /&gt;&lt;br /&gt;Your rules on roi_ind sound like they are working correct. However you are having a problem where if the user updates budget, which updates budget_ind, then budget_total doesn't get updated.&lt;br /&gt;&lt;br /&gt;This is easily rectified by adding the same rules to budget_ind as you have on roi_ind. Why do you have to duplicate this? Because rules fire when a value is changed. So right now when roi is changed, it updates roi_ind. Now that roi_ind has changed, it updates budget_total. However, if you update budget, it updates budget_ind, which unfortunately doesn't have any rules yet to update budget_total.&lt;br /&gt;&lt;br /&gt;So the solution (which you almost had) is to make sure that both _ind field have the same rules to update the _total field.&lt;br /&gt;&lt;br /&gt;Great job! Let me know how it works out!</description></item><item><title>Re: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/4003.aspx</link><pubDate>Thu, 15 Feb 2007 20:33:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4003</guid><dc:creator>funniegrrl</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4003.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4003</wfw:commentRss><description>Hi, thanks for trying to help! Here's some more information, and where I stand now.  &lt;br /&gt;&lt;br /&gt;The first field is a drop-down called &lt;b&gt;budget&lt;/b&gt;.  Based on the choice made in this field, a second field, &lt;b&gt;budget_ind&lt;/b&gt;, is populated with a number using rules set up on &lt;b&gt;budget&lt;/b&gt;.  There is conditional formatting on &lt;b&gt;budget_ind&lt;/b&gt; which changes the color of the field:  1=red, 2=yellow, 3=green, 4=blue.&lt;br /&gt;&lt;br /&gt;The third field is &lt;b&gt;roi&lt;/b&gt;, and it works in the same way, populating &lt;b&gt;roi_ind&lt;/b&gt;, which has the same conditional formatting setup.&lt;br /&gt;&lt;br /&gt;The fifth field is &lt;b&gt;budget_total&lt;/b&gt; which is a cumulative indicator, if you will.  This is the field whose value I was trying to set with a function.  What I've done now is set up rules on &lt;b&gt;roi_ind&lt;/b&gt; which state:&lt;br /&gt;If &lt;b&gt;roi_ind&lt;/b&gt; is smaller (worse) than &lt;b&gt;budget_ind&lt;/b&gt;, then use the value of &lt;b&gt;roi_ind&lt;/b&gt;.  If &lt;b&gt;roi_ind&lt;/b&gt; is larger than &lt;b&gt;budget_ind&lt;/b&gt;, then use the value of &lt;b&gt;budget_ind&lt;/b&gt;.  Basically, whichever of the two is smaller trumps the other.&lt;br /&gt;&lt;br /&gt;So, this setup works, EXCEPT ...&lt;br /&gt;If the user makes a selection in both &lt;b&gt;budget&lt;/b&gt; and &lt;b&gt;roi&lt;/b&gt;, then CHANGES one or the other or both, &lt;b&gt;budget_total&lt;/b&gt; does not update to reflect the possible new value.  Whatever the result of the rules was after the first selection in each field remains and doesn't refresh.&lt;br /&gt;&lt;br /&gt;If I could go with my original plan of  using a function, I'm assuming that it would do what I need because I could check the "Update this value ..." checkbox under the Default Value field in the Properties box.  &lt;br /&gt;&lt;br /&gt;So, any help on using either the function OR my current rules-based setup would be much appreciated.</description></item><item><title>Re: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/4002.aspx</link><pubDate>Thu, 15 Feb 2007 19:03:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4002</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4002.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4002</wfw:commentRss><description>Maybe I don't understand your scenario well enough... but you mentioned using "part of a rule". I take that to mean that are using the Rules feature available on fields. If that is the case, there is a condition portion of a rule that must be met before any actions occur. It is there that you can do your if/else. Just make sure that on the if(true) portion of the condition, you check the box to stop running rules (at the bottom of the dialog), and then you can do the same thing on the if(false) portion of the rule.</description></item><item><title>Re: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/4001.aspx</link><pubDate>Thu, 15 Feb 2007 07:37:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4001</guid><dc:creator>Shilpa Pitta</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4001.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4001</wfw:commentRss><description>Hi,&lt;br /&gt;I had a question to you-&lt;br /&gt;compare two fields, and, based on the result, display one or the other. The outcome of this function would be part of a rule about the contents of a 4th field.Is this what you want?&lt;br /&gt;Is there any field that display according to the condition for fielda and fieldb? or is that only field4?</description></item><item><title>Re: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/4000.aspx</link><pubDate>Wed, 14 Feb 2007 21:09:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4000</guid><dc:creator>funniegrrl</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4000.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4000</wfw:commentRss><description>Hi Greg --&lt;br /&gt;&lt;br /&gt;That's a good idea, but the data has to actually be used elsewhere, it's not just about hiding the one that's larger.  The outcome of this function would be part of a rule about the contents of a 4th field.&lt;br /&gt;&lt;br /&gt;Shilpa, I appreciate your help.  I'm not a programmer and I don't know anything about nodes, etc., so I'm not sure what to do with what you've provided. What is a placeholder for my info, what needs to be copied verbatim?  And, where do I enter this?  In the Display option in that field's dialog box, using the fx button?</description></item><item><title>Re: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/3999.aspx</link><pubDate>Wed, 14 Feb 2007 20:57:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3999</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3999.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3999</wfw:commentRss><description>Sounds like what you need is conditional formatting.&lt;br /&gt;Have both fields present in the view. Then add conditional formatting to fielda which hides it if its value is greater than or equal to the value in fieldb. Add conditional formatting to fieldb which hides it if its value is greater than fielda.</description></item><item><title>Re: XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/3998.aspx</link><pubDate>Wed, 14 Feb 2007 05:49:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3998</guid><dc:creator>Shilpa Pitta</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3998.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3998</wfw:commentRss><description>Hi and welcome to the forums,&lt;br /&gt;This we can do using rules in the Infopath and bu using XPath functions,&lt;br /&gt;string value1=thisXDocument.Dom.selectsinglenode(XPath1).text;&lt;br /&gt;string value2=thisXDocument.Dom.selectsinglenode(XPath2).text;&lt;br /&gt;if(value1 &amp;amp;lt; value2)&lt;br /&gt;{&lt;br /&gt;   print(value1);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;   print(value2);&lt;br /&gt;}</description></item><item><title>XPath equivalent of IF Function?</title><link>https://www.infopathdev.com:443/forums/thread/1848.aspx</link><pubDate>Tue, 13 Feb 2007 16:51:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1848</guid><dc:creator>funniegrrl</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1848.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1848</wfw:commentRss><description>Hi there --&lt;br /&gt;&lt;br /&gt;I'm relatively new to InfoPath and brand-new to XML/XLT/XPath, whathaveyou.  I have a form in which I'm trying to compare two fields, and, based on the result, display one or the other.  In Excel I'd write the statement like this:&lt;br /&gt;&lt;br /&gt;=IF(fielda&amp;lt;fieldb,fielda,fieldb)&lt;br /&gt;&lt;br /&gt;In other words, if “fielda” is smaller than “fieldb”, then display the contents of “fielda” otherwise display “fieldb”.&lt;br /&gt;&lt;br /&gt;For the life of me I can't figure out how to do this with the available XPath functions.  Can anyone offer assistance?</description></item></channel></rss>