Filter & Retrieve Data from 2 Sharepoint Lists - InfoPath Dev
in

InfoPath Dev

Filter & Retrieve Data from 2 Sharepoint Lists

Last post 10-24-2007 10:26 AM by shaun.nieves. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-15-2007 02:19 AM

    • hodgy
    • Not Ranked
    • Joined on 10-15-2007
    • Posts 2

    Filter & Retrieve Data from 2 Sharepoint Lists

    Hi, I have the following scenario:

    I am trying to populate a simple repeating section in infopath with values from 2 sharepoint lists.

    - Sharepoint List A contains info FirstName, LastName, Company.
    - Sharepoint List B Company, AddressLine1, AddressLine2, PostalCode

    What I need to achieve is that when the form is loaded, the FirstName, LastName, Company, AddressLine1, AddressLine2, PostalCode are ALL populated. I can get data from Sharepoint List A very easily, but i now need it to retrieve the Company address from List B based on the value of Company in List A. I'm sure this has been discussed, achieved before, any links to similar solutions, explanations, ideas would be greatfully received.

     Thanks

  • 10-16-2007 12:33 PM In reply to

    Re: Filter & Retrieve Data from 2 Sharepoint Lists

    One question, how do you plan on implementing your form? You can easily do this with managed code however if you want to automatically fill the fields based on a dropdown selection then it would be easier to use rules.

    Shaun Nieves
    Sharepoint Manager
  • 10-16-2007 11:47 PM In reply to

    • hodgy
    • Not Ranked
    • Joined on 10-15-2007
    • Posts 2

    Re: Filter & Retrieve Data from 2 Sharepoint Lists

    Indeed, the fields will be filled based on a drop down selection. I am currently trying to implement based on some conditional formatting but it isnt giving me what i want.

    I have repeating section A - it contains FirstName, LastName, Organisation
    I have repeating section B - it contains Organisation, Address1, Address2, Postal_Code ...etc

    I attempted to "nest" repeating section B inside repeating section A and said "hide this control" when Organisation from section B NOT EQUAL TO Organisation from section A. HOWEVER, this comparison always takes the Organisation value of the very first record in section A. I have tried to implement using current() but it's not quite giving me what i need.

    Any suggestions would be greatfully received as this is now an urgent issue.

  • 10-24-2007 10:26 AM In reply to

    Re: Filter & Retrieve Data from 2 Sharepoint Lists

    Sorry it took so long to reply. The method I use (which I found somewhere here but can't remember) is not that elegant but works for my purposes and may work for yours. Create an xml document like this

    <Support>
     <RowPosition/>
    </Support>

    Import it as a secondary file. Create a rule for your dropdown that sets RowPosition - count(../preceding-sibling::my:Your repeating node) + 1

    Then when setting up your conditional functionality, use the rowPosition in your xpath - xdXDocument:GetDOM("ProfileCapture")/dfs:myFields/dfs:dataFields/dfs:ProfileData/@WNAME[../@PROFILENUM = xdXDocument:get-DOM()/my:myFields/my:Waste_Line_Items[number(xdXDocument:GetDOM("Support")/Support/RowPosition)]/my:PROFILENUM]

     Hope this helps. Cheers!

    Shaun Nieves
    Sharepoint Manager
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.