<?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>SQL Database Integration</title><link>https://www.infopathdev.com:443/forums/47.aspx</link><description>For questions concerning issues in the integration of SQL and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Fill in user ID in field only if exists in table</title><link>https://www.infopathdev.com:443/forums/thread/101390.aspx</link><pubDate>Tue, 24 Feb 2015 15:33:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:101390</guid><dc:creator>pelizdr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/101390.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=101390</wfw:commentRss><description>&lt;p&gt;Hilary,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;thanks for the quick response, I am trying to update a query field, so I only return the values for that user ID.&amp;nbsp; After I posted the question, thinking I was stumped, I had an idea, I think near what you are suggesting, I should have put WAY more information in the original post (I blame the coffee, or lack thereof before posting).&amp;nbsp; This is a query form that pulls back user information based on their user ID.&lt;/p&gt;
&lt;p&gt;Create secondary data connection to same SQL table, retrieve on open&lt;/p&gt;
&lt;p&gt;Create a temporary field with a default value of @customer_id[. = userName()]&lt;/p&gt;
&lt;p&gt;set my query field (User ID) to that value, so if it is populated, the user ID fills in, otherwise, it is blank.&lt;/p&gt;</description></item><item><title>Re: Fill in user ID in field only if exists in table</title><link>https://www.infopathdev.com:443/forums/thread/101389.aspx</link><pubDate>Tue, 24 Feb 2015 15:22:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:101389</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/101389.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=101389</wfw:commentRss><description>&lt;p&gt;So - your rule (I guess in the form load rules? I&amp;#39;m not sure where your rule needs to go...) could have the condition of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;First dropdown - Data connection, Customer_ID&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Second dropdown - is equal to&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Third dropdown - use a formula - userName() function&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Then the actual action would be to set the field with the user name. Does that make sense? &lt;/p&gt;
&lt;p&gt;Will the main connection have all the rows for the SQL table that is being updated? If not you may need to add a secondary data connection to query for that data so you can have all the Customer_ID values to compare to.&lt;/p&gt;
&lt;p&gt;Another thing to be aware of is that XPath is case sensitive. After you have the rule condition worked out it can be modified to translate everything to lower or upper case to get around that....&lt;/p&gt;</description></item><item><title>Fill in user ID in field only if exists in table</title><link>https://www.infopathdev.com:443/forums/thread/101388.aspx</link><pubDate>Tue, 24 Feb 2015 15:07:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:101388</guid><dc:creator>pelizdr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/101388.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=101388</wfw:commentRss><description>&lt;p&gt;We have a form that automatically populates the user ID (function UserName) into a form.&amp;nbsp; This has been working well, but now I have an ask to only populate it if the UserName shows up in the SQL table that is being updated, otherwise, leave it blank.&amp;nbsp; To add insult to injury, our company has decided to not add in VSTA by default to our image, so any programming outside of the basic form is out of the question.&amp;nbsp; My pseudo logic is:&lt;/p&gt;
&lt;p&gt;Get username&lt;/p&gt;
&lt;p&gt;compare username to data connection (Data Connection -&amp;nbsp;Main Connection; field - &amp;nbsp;Customer_ID)&lt;/p&gt;
&lt;p&gt;If exist (Username) in (Main Connection Customer_ID) Then set default value of field&lt;/p&gt;
&lt;p&gt;Else NULL&lt;/p&gt;
&lt;p&gt;Any assistance would be GREALY appreciated!&lt;/p&gt;</description></item></channel></rss>