Infopath Forms that display only from drop-down - InfoPath Dev
in

InfoPath Dev

Infopath Forms that display only from drop-down

Last post 02-03-2012 08:30 AM by SeanPRyan. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-10-2011 06:43 AM

    Infopath Forms that display only from drop-down

    I'm fairly confident in submitting to SP from IP. However, I need to make a few forms that display only what's been submitted based on a drop-down list. I'm having some trouble linking a drop-down that's been bound to a field in the list and then getting the data to reflect what I chose in the drop down. Here is an example. 

     

    I have 5 groups with information each each

     

    Group Name                                        Favorite Color                                State

    Group 1                                          Red                                           TX

    Group 2                                          Green                                        NM

    ---

    Group 5                                         Blue                                          OK

     

    If I do a repeating table linked to the list I'll get everyone's data. I want to have a drop-down with the names of the groups and just display the information for the group.

     

    Sorry if I'm not clear. I want to choose Group 1 in a drop down and see Red and TX. 

     

    How do I do that or if possible, can you point me to a video tutorial with something like this?

     

     

  • 01-10-2011 07:02 AM In reply to

    Re: Infopath Forms that display only from drop-down

    It's really easy.  However, please always state the version of SharePoint and InfoPath you're working, because there are major difference between 2007 and 2010.

    In 2007, do this:

    • In the main data source of the InfoPath form, add a dropdown control bound to a text field
    • Connect this dropdown to the list data connection with the Group Name used for both Value and Display Name
    • Drag the repeating group of the list data connection to the form canvas so that it creates a repeating table that includes all the columns (adjust this table as needed)
    • Add conditional formatting to the table itself (not the fields in the table) that says, "If Group Name (SharePoint) is not equal to Group Name (InfoPath field), then hide this control."
    • That will hide the rows where Group Name does not match the dropdown selection
    • The downside of this method is it requires downloading all the data and then filtering client side, but that's how it works in 2007

    In 2010:

    • If you need the list data connection to query on form load for populating the Group dropdown, then you can't take advantage of the 2010 parameterized query feature
    • If you have another way to populate that group dropdown, then you can choose to not automatically retrieve data from the list data connection and instead query it only when the dropdown selection is made
    • If you can do this, then add a rule to the dropdown that first sets the Group Name query parameter of the list data connection to the value of the dropdown, then query.  This will ensure that only the rows with matching group names are downloaded into the form
  • 01-10-2011 07:26 AM In reply to

    Re: Infopath Forms that display only from drop-down

     Perfect, that was exactly what I was looking for. Sorry I didn't specify 2007. It is simple. Thank you very much.

  • 02-02-2012 01:14 PM In reply to

    • SeanPRyan
    • Top 200 Contributor
      Male
    • Joined on 02-02-2012
    • Kansas City area
    • Posts 62

    Re: Infopath Forms that display only from drop-down

     I can't believe it!  You made this so easy. I needed this solution exactly. Thank You!

    Sean
  • 02-03-2012 08:30 AM In reply to

    • SeanPRyan
    • Top 200 Contributor
      Male
    • Joined on 02-02-2012
    • Kansas City area
    • Posts 62

    Re: Infopath Forms that display only from drop-down

     I wonder if someone can help me a little further.  I need a form that points to a DB with about 7K records that fills a repeating table.  From here I want to choose a single record entry and click a button to populate yet another set of fields.

    I have managed to do just that and the new form that is working fine, except for one thing. First, I followed the instructions here and this worked like a charm.  Now, I have changed the dropdown list to a text field (easier than sifting through records) so that I may simply search for a record in the table. That works fine if I type the name exactly.  If I type "Ryan", my record and others with my last name populate the repeating table and allow me to make a choice of which item I want to use to populate the final fields. So, the problem:  If I type "Ry" I get nothing as I expected.  Can I make the form find records beginning with a few letters?

    My Conditional Format is if the secondary Lastname is not equal to the Main droplist then hide this control.  Is there any like clause or other trickery to make this happen or do I need to add managed code?  Thanks

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