InfoPath & Sharepoint Lists - linking list items when column values match exactly - InfoPath Dev
in

InfoPath Dev

InfoPath & Sharepoint Lists - linking list items when column values match exactly

Last post 06-12-2013 01:38 AM by CharlieBrown21. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-31-2013 02:06 AM

    InfoPath & Sharepoint Lists - linking list items when column values match exactly

    Hi All, I am new to this forum (& using InfoPath with Sharepoint!) so please bear with me! :)

    I have an InfoPath form set up and I've linked it to Sharepoint list 'A'. As forms are submitted to list 'A', each item is assigned an ID number in the list. I have a second Sharepoint list 'B' which has a column called "Related Report No." - basically this column looks up the ID numbers available in Sharepoint list 'A' and allows the user to select the related item ID number from list 'A'.

    What I'm looking for is a way to add a button or hyperlink on my InfoPath form (in list 'A') which when clicked, brings up all items in Sharepoint list 'B' when the number in the "Related Report No" column exactly matches the ID number of the item in Sharepoint list 'A'. I need it to be a kind of "view" rather than populating any list fields in InfoPath.

    I've tried all sorts of rules, filters, data connections, views etc but just can't get it right! I'm pretty sure it can be done by creating a Sharepoint view for each item ID number but this isn't really appropriate for my need and would be a nightmare as the number of records increases!!

    Does anyone know if this is possible? If so, could you please explain how?! Please let me know if you need any more information to be able to help me!

    Thanks!! :)

     

  • 05-31-2013 06:12 AM In reply to

    Re: InfoPath & Sharepoint Lists - linking list items when column values match exactly

    When you set up a data connection to a SharePoint list, you'll see two groups in the data source: queryFields and dataFields. The dataFields contains the data your data connection returned. The queryFields allow you to filter. So what you'll likely need to do is:

    1. Set up your data connection to the ShP list. Don't set it to execute on load.

    2. Add a button to the form.

    3. Add a rule to the button that sets the value of the queryField to whatever value you want, i.e. queryFields/ReportNumber = 2

    4. Add a rule that queries the data connection created in 1.

    5. Drag the dataFields repeating node into your view (to display results).

    Hope this helps!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 06-03-2013 12:35 PM In reply to

    Re: InfoPath & Sharepoint Lists - linking list items when column values match exactly

    Thank you for your help Ernesto, I will give it a try and let you know. Fingers crossed!

  • 06-07-2013 06:51 AM In reply to

    Re: InfoPath & Sharepoint Lists - linking list items when column values match exactly

    Hi Ernesto,

    I tried this a few nights ago and got to the point where when I clicked the button, the query ran and a window opened showing the results. This is fine for what I need but ... I (stupidly!) didn't save it. I'm desperately trying to recreate what I did the other evening but I just can't get the query to work. Can you help please?

    A bit more info:

    I have a button set to perform the "query with data connection" action. The data connection connects to List B. The condition on this is: The ID number in the queryfields of List A exactly matches a specific column's datafield in List B. At the moment when I click the button, nothing happens. I'm not sure what I'm doing differently from when I got it right the first time!

     Thanks in advance! :)

     

  • 06-10-2013 06:40 AM In reply to

    Re: InfoPath & Sharepoint Lists - linking list items when column values match exactly

    Hi All, I'm still stuck with this. Can anyone help please?

    Thanks.

  • 06-10-2013 11:53 AM In reply to

    Re: InfoPath & Sharepoint Lists - linking list items when column values match exactly

     I don't think you need a condition. You need to be setting the value of the queryField.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 06-11-2013 01:44 PM In reply to

    Re: InfoPath & Sharepoint Lists - linking list items when column values match exactly

    Ok, I followed your advice properly this time and I've managed to get to the point where when I click the button, it shows all list items in the repeating table. The only issue now is, I don't want to see all items - I only need to see items related to the ID number of the form open at the time when the button is pressed.

    I tried to set the value of the queryfield like you said in step 3 but I don't want to define a number here - I need to define that the value should be the ID number of the form open at the time.

    The rule I tried was: set value of field - queryFields/RelatedReportNumber = ID (queryField of Main Data Connection). And then query the secondary data connection to bring up the results.

    This just brings up all items in the secondary data connection.

    Sorry - really showing my newbie status! :(

  • 06-12-2013 01:38 AM In reply to

    Re: InfoPath & Sharepoint Lists - linking list items when column values match exactly

    I managed to figure this out using conditional formatting in the end.

    I created the data connection to list B and set the buttonn to query the data connection. I added the repeating table and placed a condition on the table that hides any results where the 2 columns are not equal. Now when the button is clicked, only items relating to the report open are shown.

    This seems to be working fine at the moment but if there's a better way to do this, please give me your advice :)

    Thanks!

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