<?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: Select value of field based on another node</title><link>https://www.infopathdev.com:443/forums/thread/91096.aspx</link><pubDate>Wed, 03 Jul 2013 17:10:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91096</guid><dc:creator>Shrout1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91096.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91096</wfw:commentRss><description>&lt;p&gt;Lol - well, I gave it some thought over lunch and the solution is actually quite simple...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I just need to use a third node. Instead of storing the &amp;quot;Sub_Node&amp;quot; value in &amp;quot;Sub_Node&amp;quot; if &amp;quot;Sub_Node_Checker&amp;quot; is &amp;quot;True&amp;quot; (I.E. the sub node value differs from the master) I just use a third node that has the exact same concatenated substring function. That way it doesn&amp;#39;t self-reference when the value changes. I&amp;#39;ll just publish *that* column to SharePoint (or push it into my double eval function) and it should avoid the entire fiasco.&lt;/p&gt;
&lt;p&gt;Thank you again for your help! You&amp;#39;ve provided me with many answers here at InfoPath dev.&lt;/p&gt;</description></item><item><title>Re: Select value of field based on another node</title><link>https://www.infopathdev.com:443/forums/thread/91094.aspx</link><pubDate>Wed, 03 Jul 2013 16:50:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91094</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91094.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91094</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Ah - I was wondering if using a default would bite us. I&amp;#39;ll take another look later today....&lt;/p&gt;</description></item><item><title>Re: Select value of field based on another node</title><link>https://www.infopathdev.com:443/forums/thread/91089.aspx</link><pubDate>Wed, 03 Jul 2013 15:16:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91089</guid><dc:creator>Shrout1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91089.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91089</wfw:commentRss><description>&lt;p&gt;Hey! I hate to come back to this but I realized a slight problem... Whenever the &amp;quot;Master_Node&amp;quot; is changed, all the fields clear (if the &amp;quot;Sub_Node_Checker&amp;quot; is equal to &amp;quot;true&amp;quot;). I believe this is due to the fact that the &amp;quot;Sub_Node&amp;quot; field&amp;nbsp;recalculates on change. Since the &amp;quot;Master_Node&amp;quot; is a part of the default expression, it forces the field to re-evaluate, do the fancy &amp;quot;multiple by 0&amp;quot; trick and then reverts itself to a&amp;nbsp;blank state.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried using the pipe operator with two substring functions, but apparently&amp;nbsp;InfoPath (or XPath)&amp;nbsp;wants valid nodes targeted on each side (NodeA[condition] | NodeB[condition]) and isn&amp;#39;t happy with a &amp;quot;substring&amp;quot; function. I also tried concatenating two substring functions together, but due to the self-reference and the re-calculation of the field at each change InfoPath ends up in an infinite loop (well, dies at 16 calculations).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is my hacked together substring function:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;concat(substring(../../my:Master_Node, 1, (../my:Sub_Node_Checker != &amp;quot;true&amp;quot;) * string-length(../../my:Master_Node)), substring(../my:Sub_Node, 1, (../my:Sub_Node_Checker != &amp;quot;false&amp;quot;) * string-length(../my:Sub_Node)))&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there a way to keep the field from clearing when the Master_Node value is changed? I tried making my Pipe operator version work again, but it just doesn&amp;#39;t want to cooperate.&lt;/p&gt;</description></item><item><title>Re: Select value of field based on another node</title><link>https://www.infopathdev.com:443/forums/thread/91080.aspx</link><pubDate>Wed, 03 Jul 2013 14:34:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91080</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91080.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91080</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;You give me waaaaaaaaaaaayyyyyyy too much credit - here&amp;#39;s where this originated: &lt;a href="http://blogs.msdn.com/b/infopath/archive/2006/11/27/conditional-default-values.aspx"&gt;http://blogs.msdn.com/b/infopath/archive/2006/11/27/conditional-default-values.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;So - the difference (of course) between != &amp;#39;true&amp;#39; and = &amp;#39;false&amp;#39; is != &amp;#39;true&amp;#39; also handles for the field being blank - I tend to prefer whatever expression will handle for the unexpected. :-)&lt;/p&gt;&lt;p&gt;&amp;nbsp;And yes - wrapped in parenthesis, we are getting 1 or 0, which we can multiply by the length of the string to figure out how many characters to return (all, or none...)&lt;/p&gt;&lt;p&gt;I do not know why this works the way it does - I imagine the secret is somewhere in the XPath specification, but I am not able to read that without suddenly getting very sleepy.&lt;/p&gt;&lt;p&gt;As to what was going wrong with your expression - I apologize. I didn&amp;#39;t even really read it, just blew it away and used my own. &lt;/p&gt;</description></item><item><title>Re: Select value of field based on another node</title><link>https://www.infopathdev.com:443/forums/thread/91065.aspx</link><pubDate>Wed, 03 Jul 2013 03:11:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91065</guid><dc:creator>Shrout1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91065.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91065</wfw:commentRss><description>Wow! I don&amp;#39;t think I *ever* would have thought to try it that way. Let me ask you a couple questions about the way you did this if you don&amp;#39;t mind:

Microsoft&amp;#39;s sytnax for substring: substring(field, start, end)

substring(Master_Node, 1, (Sub_Node_Checker != &amp;quot;true&amp;quot;) * string-length(Master_Node))

I would venture to guess that if (Sub_Node_Checker !=&amp;quot;true&amp;quot;) (i.e. &amp;quot;Sub_Node_Checker = &amp;quot;false&amp;quot;) returns &amp;quot;true&amp;quot; then that entire piece of the function returns as &amp;quot;1&amp;quot;. If &amp;quot;Sub_Node_Checker&amp;quot; = &amp;quot;true&amp;quot; on the other hand, then that returns as &amp;quot;0&amp;quot;. Because of the multiplication that takes place at the end of your expression this would cause the substring to return no characters.

Does that hold true?

Also, could you tell at all *why* my conditional selectors were failing to function? Strange that &amp;quot;../my:Sub_String_Checker&amp;quot; consistently returned the &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot; when value used separately but when used inside of the &amp;quot;sub_node&amp;quot; field as the conditional value for selecting &amp;quot;Master_Node&amp;quot; (//my:Master_Node[../my:Sub_String_Checker = &amp;quot;false&amp;quot;]) nothing would be returned whatsoever. That boggled my mind for about 5 hours today. How can an expression evaluate to &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot; and then behave as though it is returning &amp;quot;null&amp;quot; when being used as a conditional statement nested inside of a larger xpath expression?

I am truly amazed by your solution! I would never have thought to implement something in that fashion; truly a tribute to your experience that such an outside-of-the-box solution would come to mind. Thanks again!</description></item><item><title>Re: Select value of field based on another node</title><link>https://www.infopathdev.com:443/forums/thread/91063.aspx</link><pubDate>Wed, 03 Jul 2013 02:27:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91063</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91063.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91063</wfw:commentRss><description>&lt;p&gt;Here&amp;#39;s a copy of your form - I changed your default to use a substring function for this, give it a try.&lt;/p&gt;</description></item><item><title>Select value of field based on another node</title><link>https://www.infopathdev.com:443/forums/thread/91044.aspx</link><pubDate>Tue, 02 Jul 2013 15:25:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91044</guid><dc:creator>Shrout1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91044.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91044</wfw:commentRss><description>&lt;p&gt;In my attached form I am trying to set the &amp;quot;Sub_Node&amp;quot; field (which is in a repeating group) equal to the &amp;quot;Master_Node&amp;quot; field if the user chooses &amp;quot;No&amp;quot;&amp;nbsp;for the &amp;quot;Sub Node Differs from Master?&amp;quot; option button. If the user chooses &amp;quot;Yes&amp;quot; then they will be able to type in their own value.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure if I&amp;#39;m having trouble with my XPath selectors or exactly what I am doing wrong, but it seems that despite my conditions evaluating as intended, I get no values in my target field.&lt;/p&gt;
&lt;p&gt;The only 3 nodes that matter are Master_Node, Sub_Node and Sub_Node_Checker.&lt;/p&gt;</description></item></channel></rss>