Update repeatable table rows in Infopath browser forms 2010 - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Update repeatable table rows in Infopath browser forms 2010

Last post 08-03-2014 11:39 PM by JenniferLindsay. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-23-2014 10:57 AM

    Update repeatable table rows in Infopath browser forms 2010

     Anyone,

        I have a receipt table and users  may add them using repeatable table.

     

    No      Amount    Reason     Balance 
    1         10            Cash           400
    2         10            Books         390
    3         10            Transport    380
    4         10            Cash           370

     -----------------------------------------------

    No      Amount    Reason     Balance 
    1         10            Cash           400
    2         12            Books         388
    3         10            Transport    380
    4         10            Cash           370 

     

     

    The Balance will get calculated based on the amount entered.
    My issue is how do I loop thru the table when I update line no 2 so it will recalculate all the values.

    Using code you can loop from top to bottom and the actions will recalculate. But I am using a browser based form so NO Code eh!.
    All I wanna do is to loop using XPath or something with fomula rules where I can touch all the amount on every rows and the balance gets recalculated.

    Please someone 

    Thank You 

     

     

     

     

     

     

  • 08-03-2014 11:39 PM In reply to

    Re: Update repeatable table rows in Infopath browser forms 2010

     You actually don't need to loop, you just need to set the default value for the Balance field to be equal to the previous row's Balance field minus the Amount field.  Start with the following formula:

    • Balance - Amount 

    Then select the Edit xPath (advanced) checkbox, which will change what you see to something like this:

    • .../my:Amount

    Now you need to modify this formula so it looks like the following: 

    •  ../preceding-sibling::my:RepeatingTable[1]/my:Balance - ../my:Amount

    The preceding-sibling formula will tell InfoPath to get the Balance value from the row immediately preceding the current one.

    Jennifer Lindsay
    Qdabra® Software/InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

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