SetValue filter - match any field to a field in the current row? - InfoPath Dev
in

InfoPath Dev

SetValue filter - match any field to a field in the current row?

Last post 01-14-2012 12:00 PM by shniggens. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-12-2012 12:44 PM

    SetValue filter - match any field to a field in the current row?

    I want to set the value in a repeating table of any row that has a value that matches the value in the current row.   So if the GearID in any field = teh GearID in the current field, set Kit (another field in the row) to 0.

    I am trying this formula with no success -

    SetValue /xpath=/my:myFields/my:Pullsheet/my:PullSheet/my:Kit[../my:GearID=current()/../my:GearID] /value=0

     

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

    Re: SetValue filter - match any field to a field in the current row?

    Never mind.  I needed to concat in the field.  Here's what the formula that works looks like -

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

  • 01-14-2012 12:00 PM In reply to

    Re: SetValue filter - match any field to a field in the current row?

    Well that didn't work.  I'm having a hard time figuring out what formula I need for this. 

    I'm trying to perform math on "sub items" in a repeating table. 

    In my repeating table I have fields "Gear ID" and "Kit".  Kit is a checkbox with a default value of 0.  The items in my SharePoint list (that I CopyTable over) that are part of a kit, have the "Kit" Value set to 1.  In my repeating table, I hide items with a "Kit" value set to 1.    I also have a "Need" field.  If need is > 1, it sets all the rows with the same "Gear ID" to a "Kit" value of 0 (so that they show up in my table).  Only items that are part of a kit have identical "Gear ID".   This works great.  (It acutally only sets the preceeding-sibling with the gear ID, so that the top level kit item always show . . . the "main" item, so to speak).

    I also have fields "KitOriginalCount" gets it's values from a SharePoint list.  Let's say the kit includes 3 bananas, 2 apples, and 10 pineapples.  And the main item is "Fruit Basket".   So if I order 1 or more "Fruit Baskets" it will set that row's "Need" count to Need * KitOriginalCount.  This causes an infinite loop, though. 

    I need to find a way that if I set the kit "Fruit Basket" main item to 2, it needs to set the sub items "Need" to 6 bananas, 4 apples, and 20 pineapples. 

    I tried adding fields "KitNeedNumber", which the main item sets with it's "Need" field, and "KitSubItemTotal" which mulitplies "KitNeedNumber" and KItOriginalCount".  I tried to have this field set the need field if GearID = GearID, and KitOriginalCount is greater than 0.  But it still causes an infinite loop.

    Any ideas how I can accomplish what I'm trying to do here?  I was going to just settle for only displaying the "KitNeedNumber", but I save the "Need" field to a SharePoint list, and use it for reporting and other things. 

    If you read all this, I'm sorry, and thank you.  : )

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