How to show multiple related values from SharePoint lists - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to show multiple related values from SharePoint lists

Last post 02-01-2012 11:22 PM by mattpalmgren. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 12-28-2011 02:02 PM

    How to show multiple related values from SharePoint lists

    I have two SharePoint lists, Person, and Address.  The Person list has name-related columns (First, Middle, Last), and a unique identifier column called PersonID.  The Address list has address-related columns (Street 1, Street 2, City, State, Zip), and a PersonID column as well.  Each person may have more than one address.  So the two SharePoint lists may look like this:

    PERSON LIST

         PersonID        First         Last

         10001             John        Doe

         10002             Jane        Dow

    ADDRESS LIST

         PersonID       Street 1              City

         10001            123 Main            Anytown

         10001            235 A Street       Anothertown

         10002            467 B Street       Anytown

    I have created a form in the Person list that displays the person information, and their related address information. However, it only shows the first row of related address information. For example, when I pull up John Doe's form, it only displays 123 Main, Anytown.  I need it to also show the other rows of related address information, 235 A Street, Anothertown for John Doe for example.

     How can I accomplish this?

  • 12-28-2011 02:13 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    My guess would be that the control for showing the address information is not repeating. If the person may have multiple addresses, you'd want the control displaying the address information to be repeating (that is, bound to the repeating group from the Address List).

    You could have a repeating section with the fields you want to display in it - easiest way to do this is going to be to just drag the repeating group from your address list data source onto the form, and then you can see the multiple returned addresses.

    Hilary Stoupa

  • 12-28-2011 02:21 PM In reply to

    Re: How to show multiple related values from SharePoint lists

     I tried to change the control to a repeating control, but it was giving me an error.  I am new to InfoPath, but I assumed it was wanting the SharePoint list/field to be created differently?

  • 12-28-2011 02:24 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    What does the secondary data connection to the Address List look like in the data source task pane? Does it have a repeating group? Do you have more than one entry in the SharePoint list?

    Hilary Stoupa

  • 12-28-2011 02:28 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    It is just a regular connection to the SharePoint site/list.  I don't see any options for a repeating group.

    What do you mean by "Do you have more than one entry in the SharePoint list?"

  • 12-28-2011 02:41 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    Sometimes, when we create a data connection to SharePoint in InfoPath, if the data we are connecting to has only one row, we don't get back a repeating schema.

    Do you know what I mean when I say the data source task pane? It is a task pane in InfoPath that shows the structure of your data sources. If you change the drop down at the top from Main to the data connection for your SharePoint List, you should see a folder with a plus. If you click that plus, you should see another folder inside that one - probably with a blue arrow indicator to show it is repeating.

    You can attach a screenshot under the options tab - or just attach your form template and I can take a quick look at it.

    Hilary Stoupa

  • 12-28-2011 02:54 PM In reply to

    Re: How to show multiple related values from SharePoint lists

     See attached, is that what you meant?


  • 12-28-2011 03:17 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    Yup! That's exactly what I mean. :)

    So, your section on your form where you are displaying this info, what is that currently bound to? If you just want to display this data, right click the d:SharePointListItem_RW folder (the one with the "d", not the one with the "q") and select Repeating Section with controls - that should give you a correctly bound repeating section to start with.

    Hilary Stoupa

  • 12-28-2011 03:31 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    I dragged the entire d:sharepointlistitem_rw section onto the form, and selected one of the fields from the list.  It is now displaying all of the rows in the sharepoint list.  How do I filter the results to only show the rows for the current personid?

  • 12-28-2011 03:38 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    You can either add a filter to the repeating control, or you can use conditional formatting. If you are going to be using this in the browser, I'd suggest using conditional formatting (if PersonID is not equal to the selected person id, hide this control) since I've had super flaky issues with filters on repeating controls in IPFS. If this will just be used in InfoPath itself, then you can right click on your repeating section, and set a filter in the properties (I think it is under the "display" tab....)

    Hilary Stoupa

  • 12-28-2011 03:52 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    It doesn't look like I have that option.   Usually I edit the Default Value field, but it is greyed out when I add it to the form this way.  :(

  • 12-28-2011 04:17 PM In reply to

    Re: How to show multiple related values from SharePoint lists

    Yes, you can't set default values in secondary data sources, but I'm talking about conditional formatting on the repeating section itself, not the field from your main data source. You can't have one to many in a list form, which it appears is what you may be trying to accomplish...

    Hilary Stoupa

  • 02-01-2012 11:22 PM In reply to

    Re: How to show multiple related values from SharePoint lists

     Hi Hilary, thank you SO much for your help.  I was able to grab the repeating fields, and using a formatting rule, hide all unrelated records.  You saved the day. :)

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