Make repeating table rows unique - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Make repeating table rows unique

Last post 01-07-2015 12:02 AM by altaf263. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 10-11-2012 07:03 AM

    • Carel
    • Not Ranked
    • Joined on 09-14-2012
    • Posts 7

    Make repeating table rows unique

    Hi

    I have a form with an external data connection that pulls in items from a SharePoint list based on a query in form load: [AgendaItem] = [List:AgendaItem].

    These items are displayed in a repeating table. There can be more than one of the same [AgendaItem] in the list. What I want to do is hide the rows of the items that have duplicate values for a specific column in the list. Basically, I want to show all the unique items that have the specific [AgendaItem] value. The column that shoulf be unique is [Line Comment].

    I have been cracking my head trying to do this with some custom xpath implementation, but alas, no luck.
  • 10-11-2012 08:35 AM In reply to

    Re: Make repeating table rows unique

    You can do this with a preceding-sibling formula. You'll want to hide rows where the preceding sibling agenda item and the line comment are the same. I'm attaching a simple sample - save the linked form (in the heading of the post) locally, right click the saved file, and select design. Then preview it. There are two instances of the same table - the top one has conditional formatting on it.
    Hilary Stoupa

  • 10-11-2012 11:07 PM In reply to

    • Carel
    • Not Ranked
    • Joined on 09-14-2012
    • Posts 7

    Re: Make repeating table rows unique

    Oh, Really! You are just too awesome.

    I had some slight confusion tweaking it a bit, since I get my data from an external data source, but it worked out perfectly.

    Thanks a lot!
  • 10-12-2012 01:10 AM In reply to

    • Carel
    • Not Ranked
    • Joined on 09-14-2012
    • Posts 7

    Re: Make repeating table rows unique

    I made some slight errors when referencing the group in the data connection, which cause the algorithm to behave strangely. This is all quite new to me. It was as follows:
    preceding-sibling::dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Agenda_x0020_Item_x0020_No = current()/d:Agenda_x0020_Item_x0020_No and d:Line_x0020_Comment = current()/d:Line_x0020_Comment]

    I seem to have mostly sorted it out as follows:
    preceding-sibling::d:SharePointListItem_RW[d:Agenda_x0020_Item_x0020_No = current()/d:Agenda_x0020_Item_x0020_No and d:Line_x0020_Comment = current()/d:Line_x0020_Comment]

    It is now working. I cannot fathom how these rules process in InfoPath on a technical side. I am mostly a traditional coder. Doing something like this in Java or C++ would be some cheese pie.

    Anyway, thanks again
  • 10-12-2012 07:59 AM In reply to

    Re: Make repeating table rows unique

    The XPath is a relative path - since the formatting is on d:SharePointListItem_RW, that's where we start with the XPath - think of it as driving directions - if I'm at the North Pole, how do I get to New York? If I'm at the South Pole, would the directions be different?

    Your first attempt was an absolute path - starting at the root node. I like to think of that as a point on a map (latitude / longitude)....

    Hilary Stoupa

  • 01-07-2015 12:02 AM In reply to

    Re: Make repeating table rows unique

    Hi,

    sorry for opening the old thread again

    I have the same scenario but the column that i am dispalying is lookup column.

    If i try to reuse the preceding-sibling shared above for the path it is throwing error like :

    Node-test expected.
    preceding-sibling::d:SharePointListItem_RW[xdXDocument:GetDOM("MappingList")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Trainings/Value = current()/-->xdXDocument:GetDOM<--("MappingList")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Trainings/Value]

    Can you please guide me to achieve the functionality.

    I have posted my question here :http://www.infopathdev.com/forums/t/29393.aspx 

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