Check for dupliates in repeating table within repeating section - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Check for dupliates in repeating table within repeating section

Last post 06-30-2017 08:53 AM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-13-2017 05:19 AM

    Check for dupliates in repeating table within repeating section

     Hi,

     I'm using the following two formatting rules to highlights the field when the following is true (i.e. when the field is duplicated within the repeating table) which works fine within the same table

    Comment_And_Exception  is equal to preceding-sibling::my:Repeating_Comments_And_Exception/my:Comment_And_Exception

    &

    Comment_And_Exception is equal to following-sibling::my:Repeating_Comments_And_Exception/my:Comment_And_Exception 

     However, this repeating table is within a repeating section and when you insert another section the rules do not check the other repeating tables in the other sections. Which is what I'd like.

     

    If anyone can offer any help that would be much appreciated.

     

    Thanks

    Luke 

  • 06-13-2017 08:17 AM In reply to

    Re: Check for dupliates in repeating table within repeating section

    Here's a simple sample - save the attached file locally. Right click the local copy & select design. From there, you can preview / check out the formatting rules on the repeating table in design mode. :)
    Hilary Stoupa

  • 06-14-2017 12:24 AM In reply to

    Re: Check for dupliates in repeating table within repeating section

     Hi,

     

    Thank you very much that works a treat.

     One more thing but I don't think its possible is when the field is a duplicate instead of highlighting the field can the field be moved to a different repeating table (At the bottom of the form) called 'duplicated' and removed from any tables within the repeating sections.

     If you understand what I mean?

     

    Thank you very much for your help! much appreciated!  

  • 06-14-2017 11:31 AM In reply to

    Re: Check for dupliates in repeating table within repeating section

    Well - actually copying the data to a different repeating group would take code. You might be able to add another copy of the same repeating table and use "not" conditions to hide non-unique rows... but I'd guess what you are actually after is to display one of the entries in the top section, then any duplicated entries in the other table?
    Hilary Stoupa

  • 06-29-2017 03:30 AM In reply to

    Re: Check for dupliates in repeating table within repeating section

     Hi Hilary,

     Thank you for your help so far.

     I've managed to get the top repeating table to check for duplicates (Main Offers) however when trying to use the same rules for the second table (Options) I cannot seem to get it to work. I don't suppose you know how to then get the two repeating tables to check for duplicates between each other as well as themselves? I thought I'd worked it out with rule 3 but im struggling. Any help would be much appointed!

     

    File attached 

     

    Thanks

    Luke 

  • 06-29-2017 08:26 AM In reply to

    Re: Check for dupliates in repeating table within repeating section

     For the condition on the option table (rule 3) - you only need a single condition. Change the first dropdown in the condition dialog to "The expression" and paste in:

    ../../my:Main_Repeating_Offer/my:Main_Repeating_Comment[my:Main_Comment = current()/my:Option_Comment]

    This means:

    Navigate up to the Main_Repeating_Offer group and check to see if there is any Main_Repeating_Comment node where the Main_Comment field is the same as this current Option_Repeating_Comment node's Option_Comment field.

    Make sense? 

    Hilary Stoupa

  • 06-29-2017 10:59 AM In reply to

    Re: Check for dupliates in repeating table within repeating section

    Thank you, I will try tomorrow when I'm at my desk. I assume for main offers to check options i use the same rule but opposite way around? Also for some reason Main offers checks its self for duplicates, however, using the same rules on Options to check its self for duplicates it doesn't seem to work? Thanks again for the help!
  • 06-30-2017 08:53 AM In reply to

    Re: Check for dupliates in repeating table within repeating section

     If you change the first dropdown on one of your conditions on the Main repeating section to "the expression", you'll see:

    my:Main_Comment = preceding-sibling::my:Main_Repeating_Comment/my:Main_Comment

    Do the same on the Options:

    my:Option_Comment = ../../my:Option_Repeating_Offer/my:Option_Repeating_Comment/preceding-sibling::my:Option_Repeating_Comment/my:Option_Comment

    See the difference? Something went awry when you created those conditions. 

    Hilary Stoupa

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