Filter Nested Secondary Data Source Based on Repeating Primary Source - InfoPath Dev
in

InfoPath Dev

Filter Nested Secondary Data Source Based on Repeating Primary Source

Last post 02-19-2010 11:40 AM by BodhiOS. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-16-2010 04:02 PM

    Filter Nested Secondary Data Source Based on Repeating Primary Source

    I'm currently developing a checklist that presents relevant questions based on a series of drop-downs. I've hit a wall when it comes to displaying a repeating table from a secondary reference SharePoint list inside of the section containing the question. This secondary reference table currently displays all references for all questions but I'd just like it to display the relevant references. I believe the best way to filter the records is to use conditional formatting at the repeating table level to hide the control of all references that don't apply to a question.

    In an attempt to simplify the problem, I've put an expression box inside of the secondary repeating section to try to display the question ID. I've tried everything I can think of including every variation of the current() function to map the question ID.  

    Below are a few of the more obvious expression box expressions:

    xdXDocument:get-DOM()/my:myFields/my:Questions/my:ID

    current()/my:ID

    current()/../my:ID

    If there are any suggestions about another way to tackle this problem I'd be very happy to hear them.

    P.S.  I've also added some screenshots from my form.

     

    Primary Data Source

    Secondary Data Source

     Current Form

  • 02-19-2010 08:28 AM In reply to

    Re: Filter Nested Secondary Data Source Based on Repeating Primary Source

    Hi --

    I'm a little confused on what you are doing. The section on your Current Form screen shot is currently showing all the citiations for all the questions? And it should only show the citations for question 18? That would be a matter of filtering the repeating section... is that 'citation' repeating section nested in a section bound to the repeating Questions group?

    Hilary Stoupa

  • 02-19-2010 11:40 AM In reply to

    Re: Filter Nested Secondary Data Source Based on Repeating Primary Source

    Thanks for your reply. At the point when the screenshots were taken, I wasn't able to filter the "citation" list down to display only the relevant records for each question because the "current()" function wasn't able to pass the repeating "questionID" in the "Main" source to the secondary "citation" source. To get around this, I chose to hide the "citation" section by default on all questions. I then created a button in the "question" section that stores the "questionID" in a temporary field onClick, unhides the "citation" section, and filters the citations that corresponded to the value stored in the temporary field. Since I only need to display citations for 1 question at a time this is an acceptable solution.

    I'm now taking this 1 step further and using a join table to pull additional information for past findings. I have a secondary join table which contains foreign keys for "tblFindings" and the "questionID" in the "Main" source. Using the same technique as above, I'm able to pull in the secondary data sources but I'm having issues with the conditional formatting step. Instead of hiding all secondary records that don't match a value stored in the "Main" source, I now need to compare a primary key in the "Main" source to the foreign key in "JoinFindings" which also contains the corresponding foreign keys that link to the secondary "tblFindings" table.

    I'm sure this is all quite confusing at this point, but I have found that I've gotten some great ideas from other posts on this site that didn't necessarily apply to the topic I was researching. Therefore, I wanted to provide an update in case someone has a suggestion or finds themselves approaching a similar problem.

    Thanks,

    --Scott

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