Repeating table - dependent items? Formatting question. - InfoPath Dev
in

InfoPath Dev

Repeating table - dependent items? Formatting question.

Last post 01-12-2012 01:25 PM by shniggens. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-11-2012 08:05 AM

    Repeating table - dependent items? Formatting question.

    Although this scenario uses copy table, this isn't a QRules question.  Please don't move!

    I use copy table to pull in a SharePoint list for a gear order form.  This table has multiple columns for ordering gear and sorting the table, such as "need", "spare", a unique gear ID field, and category.   Users order gear by designating how much of an item they need in the "need" column.

    This all works great.  However, I have been thrown another curveball -

    Some items exist as a "kit", ie, they have multiple sub-items under the main item.  For example, a "Computer" could be a main item, but also consists of "monitor", "keyboard", and "mouse" underneath it. 

    I am going to create all the main and sub items in my SharePoint list, and copy them into the form.  However, I only want the sub-items to be viewed in the table if the main item has a "need" value of one or more.   So initially, a user would see "Computer" in the order form.  But only when they order one, will the sub-items show up. 

    Basically I want to imitate a relational table. 

    The next hurdle is going to be how to do the math if they order more than one "Computer".

  • 01-11-2012 03:14 PM In reply to

    Re: Repeating table - dependent items? Formatting question.

    So what I'm thinking is, all items in the kit will have the same unique gear ID.  If the top level item (the main item) has a "need" value of 0, then all the sub items will be hidden.  But how do I determine (in an expression) what the top (first) instance of a particular gear ID is?  How will I hide all BUT the remaining items with that gear ID if the top level gear ID "need' = 0?

  • 01-12-2012 08:56 AM In reply to

    Re: Repeating table - dependent items? Formatting question.

    OK, so if GearID = preceding-sibling::PullSheet/GearID hides all the sub items by default.  Now how do I get it to hide those sub items only if the first instance of all of those repeating values has a specified value in another column? 

  • 01-12-2012 09:15 AM In reply to

    Re: Repeating table - dependent items? Formatting question.

    Thinking out loud now -

    What if I include a "Kit" Checkbox in my table.  The main item will be checked by default (set on sharepoint).  If someone orders 1 or more of the main item, it will check the kit box (or set it to 1) for the following items with the same gear id?  Then just format on that.  Or visa versa since everything else needs to be displayed. 

  • 01-12-2012 01:25 PM In reply to

    Re: Repeating table - dependent items? Formatting question.

    OK, I have the formatting accomplished.  I set a "kit" check box in my table.  Sub items are checked by default (value of 1). Sub items also have the same "GearID" as the main item (all other, individual, non-kit items have unique GearIDs). 

    When a main item is ordered ("need" = or > 1), I run this command -

    concat("SetValue /xpath=/my:myFields/my:Pullsheet/my:PullSheet/my:Kit[../my:GearID='", GearID, "'] /value=0")

    The table hides all items that has a kit value of 1.

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