Automatically populate fields in drop down via SharePoint List - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Automatically populate fields in drop down via SharePoint List

Last post 08-24-2011 12:53 PM by DerekB. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 04-01-2009 08:40 AM

    Automatically populate fields in drop down via SharePoint List

    Hello,

    I've been successful in this demo. http://www.infopathdev.com/forums/t/312.aspx

    However, in trying to use SharePoint as a secondary data source, here's my problem.  I can pull the info from the SP List into the infoPath form.  The problem is in assigning a value to another field in InfoPath.  No matter what value I choose from my dropdown box in InfoPath, the drop down box ONLY populates with the first value in the SharePoint list.

    Example SharePoint List:

    Field1     Field2

    001         RED

    002         BLUE

    003         GREEN

    In InfoPath, if I select 003 from the dropdown, I want to see GREEN in the next box.  However, it will only show RED regardless of what I select from Field1.

    Also, do I still use the field "ID" in my example even though FIELD1 is what I'm using as the lookup?  I have it set in InfoPath to use ID as the value but display FIELD1.

      Any help is greatly appreciated...

    Thanks,
    Padraig

    Filed under:
  • 04-03-2009 12:24 PM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    Hello,

    I struggled with this one for quite some time as well.  I did find a solution to the problem, and it works perfectly.

    For what I was doing, not only did I need to select values from a drop down menu, I needed to populate a repeating table or section with the results.  The solution I was trying to get was putting the drop-down menu within the repeating table, but this does not work.  Here is what I did:

    I created the drop-down list outside the repeating table.  Within the repeating table I created a button to which I applied rules.  The rule populates the current row of the repeating table, then filters the results so that the correct value is displayed.

    My Sharepoint list contains the following values:  Application_Number and Application_Name (so these would correspond to your field 1 and field 2).

    My Infopath form contains a drop down menu called Requested software (which is populated with Application Name) and in the repeating table I have the Application Name displayed.

    In the rule, set Action to:  Set a Field's value

    Set Field to the field that you want to populate from the drop-down menu (in my example, Application Name)

    In the Value field, click the function button, Click insert field or group, choose your secondary data source from the drop-down menu, and select the field from your sharepoint list that will populate the text box.  Then, click on Filter Data.  Here I selected the Application number is equal to the Application Name field in the Infopath form.  Click OK a bunch of times, and now the value field looks like this:  @Application Name[@AppNumber = Application_Name]  (Fields preceded by @ are from your data source.  This basically says return the Application Name (from the Sharepoint list) for when the AppNumber (from the sharepoint list) is equal to the same value as the Application_Name from the Infopath form).

     

    Note:  the filter for your example should look like this:  @Field2[@Field1 = <your infopath drop down menu field name>]

  • 05-02-2009 07:06 PM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    I am pretty new to Sharepoint and Infopath myself. I have been tasked with creating a form that we can submit feedback to, and i am trying to have fields populate in the form as well. I have a similiar setup but i use 3 primary columns.

     

    My setup looks like this:

    I use a list from Sharepoint that has 4 columns in it as a data source. The first column from the Sharepoint list populates a drop down list with Employee ID #'s in Infopath. I want to select a # and hit an apply button I created that changes the view to a new form that auto populates 3 Columns at the top containing the: Employee #, Employee Name, Employees Supervisor, all of which exists on the lis in Sharepoint.

    I have tried every concievable combatination of filters and all i can get is the first column to populate with the employee #, the others are always blank...

     

    Please help if you can, i am very frusterated/new

  • 05-04-2009 05:41 AM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    Hi Spokompton,

    This should do the trick:

    Let's call your Sharepoint list columns:  Employee Number, Employee Name, Employee Supervisor

    Let's call your Infopath form fields:  Employee_Number, Employee_Name, Employee_Supervisor

    1. Connect your dropdown menu called Employee_Number to the Sharepoint list.  (The Value and Display name should both read .)
    2. Create your form fields on the second view.
    3. Add your button which will populate the form fields in the second view (on the first view where your drop-down menu is)
    4. Go to the rules in the button
    5. Create the first rule to populate the Employee_Name (do the same for the employee Supervisor):
    • The field value should be Employee_Name
    • For the value, click the fx button
    • Click insert field or group
    • Choose your Sharepoint data connection
    • Select the Employee Name field (Sharepoint list)
    • Click Filter Data
    • The first drop down menu should be Employee Number (Sharepoint list), second is equal to, third Employee_Number (Infopath form)
    1. Last, set a rule to switch the form's view.
  • 05-06-2009 04:33 PM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    Thanks! This worked like a charm!

  • 08-24-2011 10:51 AM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    Hi
     I used this solution and it works great but I put it in a repeating section. When I do the insert new item and select a diffrent value in the list box the the values from the 1st row populate my fields. Any ideas???

     

    Thanks

    Vic

    vmanfredi@westonproducts.com

  • 08-24-2011 11:10 AM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    Hi,

    You can use the same method, however the button that is running the rules must also be in the repeating section.  If it is not in the repeat, it will always target the first row.  If it is in the repeat, it will target the same instance of the repeat that the button is in.

  • 08-24-2011 11:17 AM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    Thanks for the reply. The button is in the repeating section

  • 08-24-2011 11:35 AM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    Is your drop-down menu inside or outside the repeating element?  It should be outside of it.

     

  • 08-24-2011 11:42 AM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    it was inside I moved it out side. Selected an item clicked get data and it filled in the fields in the repeating section but when i did insert item to make another repeating section the list box greyed out and i could not select the next item for the new section

  • 08-24-2011 11:53 AM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    If you look at the drop down menu, there is probably a little red x on it.  I'm guessing that when you moved the drop-down menu outside the repeating section, you didn't move it in the data source as well.  I think your data source looks like this:

    MyFields

       RepeatingSection

           DropDown

           Field1

    It needs to look like this:

    MyFields

    DropDown

        RepeatingSection

        Field1

  • 08-24-2011 12:03 PM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    thanks for all the help!!! I really appriciate this.I moved it but the fileds on the second repeating section are still filling in with the data from the 1st enty in my sharepoint list. I have live meeting if you think connecting in would help all i need is an email addy.

     

     

  • 08-24-2011 12:11 PM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    That may mean your filter on your button may be wrong. 

    When you go into the rules on the button and set the field's value in the repeating section:

    1)  Click the Fx button

    2) Set the Field box to the column from the SharePoint list

    3) Click Filter Data

    4)  The filter should read SharePoint Field(the field that is populating your drop-down menu) is equal to Form Field (the one that is the drop-down menu)

     

  • 08-24-2011 12:43 PM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    HUZZAH!!!!!! Thank you so much for helping me out. That did the trick.

  • 08-24-2011 12:53 PM In reply to

    Re: Automatically populate fields in drop down via SharePoint List

    You're quite welcome :)
Page 1 of 1 (15 items)
Copyright © 2003-2012 Qdabra Software. All rights reserved.
View our Terms of Use.