Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

Last post 02-19-2018 02:37 PM by Hilary Stoupa. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 02-14-2018 08:44 AM

    Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

     Hi, I need to pick someone's brain for ideas. I have 2 hide formatting rules that I need to work together, with the possibility of some thing else to get this to work (maybe a qRules thing?). (InfoPath 2010, qRules 8.1). Attaching screenshots with more info in zip file.

    I have a form with a repeating section that has a table with a "fake group header". So, the "group" is Customer, then the table records are details about the record. So normally the customer group would appear on every record, but the Customer does not repeat (is hidden with format rule on the customer field) to records that have the same customer (d:Customer = preceding-sibling::d:SharePointListItem_RW/d:Customer). So for all the records that apply to that customer, you only see the customer name once. This works great.

    Next, I have added a keyword search for one field (Problem Statement). I hide the records that don’t match the keyword by a format rule on the repeating section (not(contains(d:Problem_x0020_Statement_Upper, xdXDocument:get-DOM()/my:myFields/my:Search/my:txt_ProblemStmnt))). This works to hide the applicable records.

    However, if the first record of a given customer is hidden (does not match) then I loose my Customer “group header”. Because technically that is the first instance of the customer field and the rest are hidden (because of preceding sibling).

    So, somehow I need to work the keyword format rule into the customer field to work in conjunction with the preceeding sibling hiding of that field. I wasn’t able to get the right combination of rules on the Customer field, but did make headway by adding a second Customer field with different rules (the second Customer field is in Red). I have it almost all the way…

    This all will make sense better with screenshots, so I'm going to attach those (with further explanation).

    I need help getting that one last hurdle... I've tried stuff with row counts (but can't even get an accurate row count to work, I think something about it either being a repeating section (as opposed to a repeating table) or maybe because this is reading a secondary data source? Not sure.

    Any other ideas? Maybe I need to scap this and do something totally different?

    Thanks!






  • 02-15-2018 07:28 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    Hey, Gwen - can you send your form my way so I can take a look?
    Hilary Stoupa

  • 02-16-2018 07:52 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    Okay, here is a sample that I think has the outcome you need - check it out & let me know if you need help w/ the correct XPaths for your form. :)
    Hilary Stoupa

  • 02-19-2018 07:36 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

     I can't open the form. It says it was created in a later version. I have 2010. Can you downgrade it? :)

  • 02-19-2018 07:57 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    Whoops, sorry about that. Here it is as 2010.
    Hilary Stoupa

  • 02-19-2018 08:08 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

     Thanks! I'll check it out :)

  • 02-19-2018 08:24 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

     Just to clarify - on your field 1 drop down, this is the keyword search (I'm thinking). On the hide rule for the repeating section, you have value contains field1. I'm thinking you mean doesn't contain right? You want to hide it if the value is not found in the text. When I swap that to "does not contain", the count gets off... but I'm guessing those could be altered as well (I'm trying to wrap my brain around those right now :) ...these are awesome)

  • 02-19-2018 08:47 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    So - this doesn't work as it is currently set up? I thought when I previewed it that it did what you needed.
    Hilary Stoupa

  • 02-19-2018 09:59 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    Sorry, it does the opposite. If I pick A for the field1, I would expect values with an "a" to show, but instead they hide, and you get all values that don't have an "a".  So, it's an "opposite key word search" :)

  • 02-19-2018 10:06 AM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    I got it, sorry about that. I'll change it later today & upload it again.
    Hilary Stoupa

  • 02-19-2018 12:07 PM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    Try this one. EDIT - the attachment isn't showing so I'm editing to see if it uploads. :)
    Hilary Stoupa

  • 02-19-2018 02:01 PM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    I'm attaching my xsn...

    I'm sorry, but I just can't get the preceding sibling just right....the customer is repeating (yellow), but I think all the other parts are working. I also tried to build the calculated value, like you did, to test and I can't get that work either. So, I know it's something here. Here's my rule:

    count(preceding-sibling::SharePointListItem_RW[Customer = current()/Customer and contains(Problem_x0020_Statement, xdXDocument:get-DOM()/my:myFields/my:Search/my:txt_ProblemStmnt)]) > 0 

    Here's my xpath for Customer:  /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Customer (I've tried to include various parts of this and it fusses at whatever I try, except for the above).

    Here's my xpath for txt_ProblemStmnt:  /my:myFields/my:Search/my:txt_ProblemStmnt

    Thanks for all your help!!! 

  • 02-19-2018 02:37 PM In reply to

    Re: Hide Repeating Value but have Other Hide Rules as well, so Preceeding Sibling isn't always working

    You didn't have the namespace prefixes in your XPaths for your 2ds - easy mistake to make & my 2ds didn't have namespace prefixes. count(preceding-sibling::d:SharePointListItem_RW[d:Customer = current()/d:Customer and contains(d:Problem_x0020_Statement, xdXDocument:get-DOM()/my:myFields/my:Search/my:txt_ProblemStmnt)]) > 0
    Hilary Stoupa

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