none
how to use drop down list to filter data in textboxes in infopath form

    Question

  • I have a scenario that i have 4 fields in my infopath form .

    Staff no,Staff name ,Location ,Nationality,Department .

    And Same fields in my share point list . My list is connected to my form .

    Staff no is drop down list and sttaff numbers are populated  populated automatically from my sharepoint list .What i want is that when i select the staff no from drop down list  the remaining fields should be filled automatically according to the dropdown selection. or corresponding to sraff no

     
    Wednesday, August 28, 2013 2:12 PM

Answers

  • Hi Junaid,

    According to your post, you want to populate the other fields' value based on the Staff no field.

    If the fields in the form are in text box type, we can do the steps below to reach what you want:
    1. Add the SharePoint list to the form as an external data.
    2. Right click the Staff no field, click Change Control, select Drop-Down List Box.
    3. Right click the Staff no field, click Drop-Down List Box Properties, and choose Get choices from an external data source.
    4. Choose the list added in step1 in Data source, click XPath behind Entries, click the Staff number column in the list, select Show only entries with unique display names.
    5. Right click the Staff no field in the form, click Manage Rules, click New in the Rules panel, then select Action.
    6. Click Add and select Set a field's value, select other fields which you want to populate the value in Field text box.
    7. Click fx behind Value text box, choose Insert Field or Group, choose the SharePoint list(secondary) in the Fields and select the corresponding column in the list, then click Filter Data.
       Click Add, select the Staff number column in the list in the first box, select is equal to in the second box, choose select  a field or group in the third box, then choose Main in the Fields and select the Staff no field in the form.

    All the other fields' value should be set like the step6 to step7.

    Best regards.
    Thanks

    Tuesday, September 03, 2013 12:18 PM
    Moderator

All replies

  • Hi,

    Try steps in the following links

    http://butdoesitwork.typepad.com/but_does_it_work/2011/03/infopath-2010-creating-cascading-dropdown-fields-.html

    https://www.nothingbutsharepoint.com/sites/eusp/pages/browser-based-infopath-2010---creating-cascading-dropdown-fields-with-no-code.aspx

    you can create a data connection which gets data from the list , Have a filter . get the values which matches with the staff no which is selected in the dropdown and display in the needed fields.

    In case of textbox , In the default value insert the field value and have the filter.

    Please let us know whether it helped you.

    Regards,

    Siva.


    Wednesday, August 28, 2013 3:41 PM
  • Hi Junaid, you need to set up rules on the dropdown for each of the remaining fields per staff #. The rule would be: if Staff No.="this," then set a field's value to "this." (where the info. would be the corresponding field in your list.)

    cameron rautmann

    Wednesday, August 28, 2013 5:17 PM
  • First of all thanks alot for help ............

    I have followed this tutorial .

    https://www.nothingbutsharepoint.com/sites/eusp/pages/browser-based-infopath-2010---creating-cascading-dropdown-fields-with-no-code.aspx

    Every thing was going fine.But last step means step 7.When i set the rule to empty the city dropdown .I got

    error "Some rules were not applied" .

    And another thing is that i want to populate data in textboxes. 

    Help me ..

    Thursday, August 29, 2013 12:16 PM
  • Hi Junaid,

    According to your post, you want to populate the other fields' value based on the Staff no field.

    If the fields in the form are in text box type, we can do the steps below to reach what you want:
    1. Add the SharePoint list to the form as an external data.
    2. Right click the Staff no field, click Change Control, select Drop-Down List Box.
    3. Right click the Staff no field, click Drop-Down List Box Properties, and choose Get choices from an external data source.
    4. Choose the list added in step1 in Data source, click XPath behind Entries, click the Staff number column in the list, select Show only entries with unique display names.
    5. Right click the Staff no field in the form, click Manage Rules, click New in the Rules panel, then select Action.
    6. Click Add and select Set a field's value, select other fields which you want to populate the value in Field text box.
    7. Click fx behind Value text box, choose Insert Field or Group, choose the SharePoint list(secondary) in the Fields and select the corresponding column in the list, then click Filter Data.
       Click Add, select the Staff number column in the list in the first box, select is equal to in the second box, choose select  a field or group in the third box, then choose Main in the Fields and select the Staff no field in the form.

    All the other fields' value should be set like the step6 to step7.

    Best regards.
    Thanks

    Tuesday, September 03, 2013 12:18 PM
    Moderator