Filtering Secondary data source based on Field value in a Repeating Section - with a twist in the tail! - InfoPath Dev
in

InfoPath Dev

Filtering Secondary data source based on Field value in a Repeating Section - with a twist in the tail!

Last post 04-06-2018 06:01 AM by merley72. 16 replies.
Page 2 of 2 (17 items) < Previous 1 2
Sort Posts: Previous Next
  • 04-05-2018 02:37 PM In reply to

    Re: Filtering Secondary data source based on Field value in a Repeating Section - with a twist in the tail!

    So - query fields are only equivalence in the list data connection. You could add a show hide button that would set Field (in the list query fields) to Matrix and your new simple string field to the OverallLevel (be sure this control is inside the repeating group) and then run the query. This will return just the items that match on those two fields. I added a button on your form with some rules - save the attached file locally, right click and select design to open in design mode. I'm setting the query Query field to the OverallLevel - you'll change that to whatever field has the exact match. Note that I set the query fields then execute the query - that returns matches. If it doesn't, put the whole secondary data source on your form and add a button to query it so you can experiment with the correct values for the query fields.
    Hilary Stoupa

  • 04-06-2018 06:01 AM In reply to

    Re: Filtering Secondary data source based on Field value in a Repeating Section - with a twist in the tail!

    Hi Hilary, I think I'm giving up on this because I've thought of a couple of problems with this button approach.  Firstly (and for the first instance of the Repeating Section) you can successfully filter the repeating secondary data source OK once you click the button - great - however what then becomes clear is that when you choose an alternative drop-down options which might use a different OverallLevel number, of course it has the results from that same Keywords List data source but only has the value of the filtered elements to choose from, and of course it fails turning the OverallLevel field blank.  I overcame that by adding two extra rules onto the OverallNumber field to reset the filter of Query to blank and re-ran the Keywords before the calculation.  That fixed it nicely and when I created a second repeating section both Number and Level fields ran independently and OK.  Success.

    But.  Reverting to look at the 'Button' at this point, if both OverallLevel numbers in their respective sections were different, and the button was pressed, it failed so I took your advice and removed the repeating secondary data source entirely, and re-added the entire set of fields as a repeating section, just to see what was happening.  I did include a filter on the section such that if 'Field' is NOT = 'Matrix' then hide and this limited the elements to just those Keyword options.

    However I've identified a black hole I think here which is that if the value of the fields in total is set correctly by the button, then unfortunately it doesn’t only affect the 'Icon' field in the repeating section in which that button resides, it refreshes the values of the Icon fields for the whole form, and therefore the 'Icon' field in every other sections also get altered. 

    Either way, I've decided enough is enough at this point.  Aaarrrgghhh.  I've now stopped bashing my head against the wall and it is great!!!!!

    I might revert to a much simpler method I used before which was to hold the secondary data Keyword images in a number of separate sections (numbered 1 through 10) and have specific 'hide whens' on each section to reflect the thresholds directly.  This worked but was a clunky design but so be it.

     

    Thanks very much for all your help.  Alan C.




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