<?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: Extreme newbie question--adapting an MSDN example to add items to a SharePoint list</title><link>https://www.infopathdev.com:443/forums/thread/68596.aspx</link><pubDate>Wed, 20 Jul 2011 17:44:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68596</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68596.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68596</wfw:commentRss><description>&lt;p&gt;You are welcome, glad you got it squared away!&lt;/p&gt;</description></item><item><title>Re: Extreme newbie question--adapting an MSDN example to add items to a SharePoint list</title><link>https://www.infopathdev.com:443/forums/thread/68595.aspx</link><pubDate>Wed, 20 Jul 2011 17:36:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68595</guid><dc:creator>ThoughtProcess</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68595.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68595</wfw:commentRss><description>&lt;p&gt;Aaah, I see now.&amp;nbsp; I originally had set the drop-down properties to use the &amp;quot;Title&amp;quot; for both the Value and the Display Name.&amp;nbsp; I corrected it so now the Value is the ID and the Display Name is the title.&lt;/p&gt;&lt;p&gt;Works like a charm!&amp;nbsp; &lt;b&gt;THANK YOU!!!&lt;/b&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Extreme newbie question--adapting an MSDN example to add items to a SharePoint list</title><link>https://www.infopathdev.com:443/forums/thread/68593.aspx</link><pubDate>Wed, 20 Jul 2011 17:29:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68593</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68593.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68593</wfw:commentRss><description>&lt;p&gt;Well, the drop down is using a ShP list for its values, right? So you could use the ShP ID for the &lt;em&gt;value&lt;/em&gt; and whatever column you want for the display. Then you have the ID number in your main data source.&lt;/p&gt;</description></item><item><title>Re: Extreme newbie question--adapting an MSDN example to add items to a SharePoint list</title><link>https://www.infopathdev.com:443/forums/thread/68591.aspx</link><pubDate>Wed, 20 Jul 2011 17:05:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68591</guid><dc:creator>ThoughtProcess</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68591.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68591</wfw:commentRss><description>&lt;p&gt;Hilary, That&amp;#39;s very good to hear!&lt;/p&gt;&lt;p&gt;I did some experimenting based on your instructions, and found something interesting.&amp;nbsp; When I do a hard-coded test, &lt;b&gt;the index and ;# alone &lt;/b&gt;seems to work. For example, if I have a lookup column in my SharePoint list that&amp;#39;s called OfficeLocation, I can add a new entry to that list simply by including something like &amp;quot;&amp;lt;Field Name=&amp;quot;OfficeLocation&amp;quot;&amp;gt;2;#&amp;lt;/Field&amp;gt;&amp;quot; in my outgoing CAML.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Now for my second question: &lt;/b&gt;&lt;/p&gt;&lt;p&gt;If the user picks a lookup item from a drop-down on my InfoPath form, how do I figure out the item index for their selection?&lt;/p&gt;&lt;p&gt;Thanks! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Extreme newbie question--adapting an MSDN example to add items to a SharePoint list</title><link>https://www.infopathdev.com:443/forums/thread/68587.aspx</link><pubDate>Wed, 20 Jul 2011 16:39:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68587</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68587.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68587</wfw:commentRss><description>&lt;p&gt;I think you can - it is just a matter of syntax.&lt;/p&gt;
&lt;p&gt;You need to submit the data in the format that the lookup expects - SharePoint list item ID, semicolon, pound symbol, and display value (although it may be possible to just submit the ID, you should experiment with this). For example, 1;#mydisplay&lt;/p&gt;
&lt;p&gt;I&amp;#39;m attaching a screenshot from an owssvr.dll URL on a list with a lookup column.&lt;/p&gt;</description></item><item><title>Re: Extreme newbie question--adapting an MSDN example to add items to a SharePoint list</title><link>https://www.infopathdev.com:443/forums/thread/68580.aspx</link><pubDate>Wed, 20 Jul 2011 14:17:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68580</guid><dc:creator>ThoughtProcess</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68580.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68580</wfw:commentRss><description>&lt;p&gt;http://www.infopathdev.com/forums/p/5495/20809.aspx#20809&lt;/p&gt;&lt;p&gt;I found an interesting comment by Matt Faus:&amp;nbsp; &amp;quot;You can&amp;#39;t submit Lookup types to SharePoint.&amp;quot;&lt;/p&gt;&lt;p&gt;Can someone confirm whether this is still true with InfoPath 2007?&amp;nbsp; If so, how can I work around this problem?&amp;nbsp; Our system absolutely needs lookup functionality!&lt;/p&gt;&lt;p&gt;Thanks! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Extreme newbie question--adapting an MSDN example to add items to a SharePoint list</title><link>https://www.infopathdev.com:443/forums/thread/68562.aspx</link><pubDate>Tue, 19 Jul 2011 20:17:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:68562</guid><dc:creator>ThoughtProcess</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/68562.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=68562</wfw:commentRss><description>&lt;p&gt;Hi guys!&amp;nbsp; First post ever here on InfoPathDev.com :)&amp;nbsp; I am an &amp;quot;intermediate&amp;quot; C++/C# developer, but this is my first time ever doing anything web-related.&amp;nbsp; So I have a bunch of questions.&lt;/p&gt;&lt;p&gt;My end goal is to create an InfoPath form that will let users add records to a SharePoint list.&amp;nbsp; There will be five or six fields.&amp;nbsp; Some fields will be single lines of text, others will be lookup drop-downs that refer to elements in other SharePoint lists, and I&amp;#39;ll also have a date picker.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I have successfully followed &lt;a href="http://msdn.microsoft.com/en-us/library/cc162745%28v=office.12%29.aspx" title="this MSDN InfoPath tutorial"&gt;this MSDN InfoPath tutorial&lt;/a&gt;, which shows how to implement Submit functionality using CAML XML and C# code.&amp;nbsp; It works great.&amp;nbsp; But I have a ton of questions... :-P&lt;br /&gt;&lt;/p&gt;&lt;p&gt;For example, let&amp;#39;s say I have the following fields:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;FirstName&lt;/li&gt;&lt;li&gt;LastName&lt;/li&gt;&lt;li&gt;Phone&lt;/li&gt;&lt;li&gt;Email&lt;/li&gt;&lt;li&gt;BranchLocation&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Let&amp;#39;s say that last field, &lt;b&gt;BranchLocation&lt;/b&gt;, is a dropdown that connects to another SharePoint list that I have called &lt;span style="font-weight:bold;"&gt;Branches&lt;/span&gt;.&amp;nbsp; I have no problem setting up that lookup, so when I click on the dropdown, I see a list of the five or six entries that I have in the &lt;span style="font-weight:bold;"&gt;Branches&lt;/span&gt; list.&lt;/p&gt;&lt;p&gt;The problem is, the plain-vanilla C# code in the example doesn&amp;#39;t seem to work with lookup tables.&lt;/p&gt;&lt;p&gt;Here&amp;#39;s the existing code, with another small section added to handle the &lt;span style="font-weight:bold;"&gt;BranchLocation&lt;/span&gt;: &lt;/p&gt;&lt;pre&gt; &lt;span style="color:Green;"&gt;// See if any new contacts have been added.&lt;/span&gt;
   &lt;span style="color:Blue;"&gt;if&lt;/span&gt; (xiNewContacts.Count &amp;gt; 0)
   {
      &lt;span style="color:Blue;"&gt;while&lt;/span&gt; (xiNewContacts.MoveNext())
      {
         &lt;span style="color:Green;"&gt;// Set the values in the Add List Item Template &lt;/span&gt;
         &lt;span style="color:Green;"&gt;// XML file using the values in the new row.&lt;/span&gt;
         xnCAML.SelectSingleNode(
            &lt;span&gt;&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Title&amp;#39;]&amp;quot;&lt;/span&gt;, ns)
            .SetValue(xiNewContacts.Current.SelectSingleNode(
            &lt;span&gt;&amp;quot;my:Title&amp;quot;&lt;/span&gt;, ns).Value);
         xnCAML.SelectSingleNode(
            &lt;span&gt;&amp;quot;/Batch/Method/Field[@Name=&amp;#39;FirstName&amp;#39;]&amp;quot;&lt;/span&gt;, ns)
            .SetValue(xiNewContacts.Current.SelectSingleNode(
            &lt;span&gt;&amp;quot;my:FirstName&amp;quot;&lt;/span&gt;, ns).Value);
         xnCAML.SelectSingleNode(
            &lt;span&gt;&amp;quot;/Batch/Method/Field[@Name=&amp;#39;LastName&amp;#39;]&amp;quot;&lt;/span&gt;, ns)
            .SetValue(xiNewContacts.Current.SelectSingleNode(
            &lt;span&gt;&amp;quot;my:LastName&amp;quot;&lt;/span&gt;, ns).Value);
         xnCAML.SelectSingleNode(
            &lt;span&gt;&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Phone&amp;#39;]&amp;quot;&lt;/span&gt;, ns)
            .SetValue(xiNewContacts.Current.SelectSingleNode(
            &lt;span&gt;&amp;quot;my:Phone&amp;quot;&lt;/span&gt;, ns).Value);
         xnCAML.SelectSingleNode(
            &lt;span&gt;&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Email&amp;#39;]&amp;quot;&lt;/span&gt;, ns)
            .SetValue(xiNewContacts.Current.SelectSingleNode(
            &lt;span&gt;&amp;quot;my:Email&amp;quot;&lt;/span&gt;, ns).Value);
&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;         &lt;span style="color:Green;"&gt;// NEW CODE!!!!&lt;/span&gt;&lt;br /&gt;&amp;nbsp;         &lt;span style="color:Green;"&gt;// NEW CODE!!!!&lt;/span&gt;
&amp;nbsp;         &lt;span style="color:Green;"&gt;// NEW CODE!!!!&lt;/span&gt;

         xnCAML.SelectSingleNode(
            &lt;span&gt;&amp;quot;/Batch/Method/Field[@Name=&amp;#39;BranchLocation&amp;#39;]&amp;quot;&lt;/span&gt;, ns)
            .SetValue(xiNewContacts.Current.SelectSingleNode(
            &lt;span&gt;&amp;quot;my:&lt;/span&gt;&lt;span&gt;BranchLocation&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;, ns).Value);&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;         &lt;span style="color:Green;"&gt;// NEW CODE!!!!&lt;/span&gt;&lt;br /&gt;&amp;nbsp;         &lt;span style="color:Green;"&gt;// NEW CODE!!!!&lt;/span&gt;
&amp;nbsp;         &lt;span style="color:Green;"&gt;// NEW CODE!!!!&lt;/span&gt;


         &lt;span style="color:Green;"&gt;// Set the values of the Changed and Delete columns to&lt;/span&gt;
         &lt;span style="color:Green;"&gt;// &amp;quot;FALSE&amp;quot;.&lt;/span&gt;
         xnCAML.SelectSingleNode(
            &lt;span&gt;&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Changed&amp;#39;]&amp;quot;&lt;/span&gt;, ns)
            .SetValue(&lt;span&gt;&amp;quot;FALSE&amp;quot;&lt;/span&gt;);
         xnCAML.SelectSingleNode(
            &lt;span&gt;&amp;quot;/Batch/Method/Field[@Name=&amp;#39;Delete&amp;#39;]&amp;quot;&lt;/span&gt;, ns)
            .SetValue(&lt;span&gt;&amp;quot;FALSE&amp;quot;&lt;/span&gt;);

         &lt;span style="color:Green;"&gt;// Set the value of Cmd attribute to &amp;quot;New&amp;quot;.&lt;/span&gt;
         xnCAML.SelectSingleNode(&lt;span&gt;&amp;quot;/Batch/Method/@Cmd&amp;quot;&lt;/span&gt;, ns)
            .SetValue(&lt;span&gt;&amp;quot;New&amp;quot;&lt;/span&gt;);
         
         &lt;span style="color:Green;"&gt;// Submit the new row.&lt;/span&gt;
         wsSubmit.Execute();
      }
   }&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;When I try to run this, nothing happens.&amp;nbsp; When I look at the contents of &lt;span style="font-weight:bold;"&gt;xnCAML&lt;/span&gt;, I can see that the &lt;span style="font-weight:bold;"&gt;&amp;lt;BranchLocation&amp;gt;&lt;/span&gt; tag in the CAML is set to the plain text value of the selected item in the &lt;span style="font-weight:bold;"&gt;BranchLocation &lt;/span&gt;drop down.&amp;nbsp; Should that be an item index instead of a string?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks!&lt;br /&gt;--Peter &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>