Populate a dropdown and a textbox based on values on 2 dropdown. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Populate a dropdown and a textbox based on values on 2 dropdown.

Last post 06-06-2011 10:07 AM by mrbroschat. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-06-2011 01:38 AM

    Populate a dropdown and a textbox based on values on 2 dropdown.

    Here's the scenario, I have this 2 dropdowns, and 1 textbox

    dropdowns are : FirstName, LastName

    textbox is  :       Email

    here's the content for the FirstName and LastName dropdown:

    FirstName - TestFName                               LastName - User1

                       TestFName1                                               User2

                       TestFName                                                User3

     

    If I choose TestFName in the dropdown, the LastName dropdown will have User1 and User3 as choices. and after choosing LastName value, the Email textbox will be populated with it's corresponding Email Address

  • 06-06-2011 10:07 AM In reply to

    Re: Populate a dropdown and a textbox based on values on 2 dropdown.

    1. Make a three-column list in SharePoint: Firstname, Lastname, Email; provide some values.
    2. Create an InfoPath form with two dropdowns (ddFirstname, ddLastname) and a text field (txtEmail).
    3. Create a Data Connection to that SharePoint list. I called mine dcEmailList. Include all three important fields.
    4. In properties for the ddFirstname InfoPath field, get its value from the dcEmailList data connection (Firstname).
    5. For ddLastname properties, choose Lastname from the dcEmailList data connection, but with that selected, choose to Filter Data.
    6. Create a filter condition such that "Firstname is equal to ddFirstname." Notice that you choose the first value from the Secondary data source, and the second value (ddFirstname) from the Main data source. This is a conventional cascading drop-down.
    7. For txtEmail, you will derive its value from the "Insert Field or Group..." button. Essentially, you will be saying "Give me the value of the Email field in the SharePoint list when the Firstname is [what was chosen for Firstname] and the Lastname is [what was chosen for Lastname]." You get the values for "what was chosen" by pointing to the corresponding field in the Main data source.
     
     In this scheme, whenever you have chosen values for both Firstname and Lastname, you will automatically populate the text field with the corresponding Email value.
     

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.