Update field in one row only of a repeating table - InfoPath Dev
in

InfoPath Dev

Update field in one row only of a repeating table

Last post 03-11-2013 08:38 AM by HelenW. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-11-2013 06:42 AM

    Update field in one row only of a repeating table

    I'm banging my head against the wall here; I can't seem to get this to work. I have a repeating table that I'm using to calculate costs of items. The first row contains my company's item, the subsequent rows contain competitors items. Each row has a brand name entered and the first row is always my company's product. Outside of the repeating table, I have a field to record Gross to Net % (GTN%). The net cost of my company's item needs to be determined by using a formula : Gross Price - (Gross Price * GTN%) The competitors simply need to be the same as the gross price. My struggle lies in getting just the first row of the table to update if the GTN% value is entered. I can get it to update the Net Price for each row before the GTN% is added. Each row shows it's unique values. Once I add a number to the GTN% field, it does the calculation and updates the net price across all rows. I'm missing something here...anyone have any clues for me? If you need more information, please let me know. I'm using InfoPath 2007, FYI. I'd appreciate any ideas! Thanks!
  • 03-11-2013 08:04 AM In reply to

    Re: Update field in one row only of a repeating table

    Hi - since the GTN field is outside the repeating group, any rules on it that set values to a repeating field will set all instances of the field. The same will happen with controls like buttons - if a button is inside a repeating section or table, its actions will affect only the instance that it is inside. If outside, it will affect all instances.

    InfoPath makes this tricky, because it won't let you set just the first row. But I think you could do this with a helper field inside your repeating table. You can add a field in the data source task pane (it doesn't have to show on your form) and give it a default value of the main GTN% field. Then, you can put a rule on this new helper field & add some conditions so that if this is the first instance of the repeating table, use the special formula, and for all the other instances, use the gross. Let me know if you need a quick sample or more info.

    Hilary Stoupa

  • 03-11-2013 08:38 AM In reply to

    Re: Update field in one row only of a repeating table

    Dang...that was so easy, I wish I'd thought of it! I put a rule on a hidden field on the table and specified when table brand = company brand, set the value! Perfect! Thanks so much Hilary! - Helen
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.