Copying Text within a repeating table to another field within the same table - InfoPath Dev
in

InfoPath Dev

Copying Text within a repeating table to another field within the same table

Last post 06-01-2007 09:22 AM by davidair. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-31-2007 10:00 PM

    Copying Text within a repeating table to another field within the same table

    I've been using InfoPath for the past three weeks and would like to know if I need to use code to solve the problem below. 1. I have a repeating table - 2 levels deep. The top level details a number of categories within a Fund. E.g. Consultants, Travel etc. The lowest level contains line items per category. E.g. Consultants -> Engineers, Consultants -> Qty Surveyors. Each line item has an associated budget and actual amount. I want to know if it is possible to set the budget amount to the actual amount without writing any code. The Form is read-only. When ever I use filters or edit the XPath the actual amount is set to the same value in every case. 2. If I need to write some code what are my options? We are using InfoPath 2007, SharePoint 2007 & SharePoint Designer as our development tools. Our users have InfoPath 2003 installations. Thanks
    Welsh guy living in Oz
  • 06-01-2007 09:22 AM In reply to

    Re: Copying Text within a repeating table to another field within the same table

    There should be no problem to do this without writing code. Quick sidenote: if your clients are using IP2003, make sure you always save your solutions in IP2003 (I know it's obvious but wanted to make sure).

    So, to achieve what you're trying to do, it's best to use rules. Double click on a control bound to Actual Amount, select "Rules", click on "Add", give your rule a nice meaningful name, click on "Add Action", select "Set a field's value" from the dropdown, pick your target field (namely "Associated Budget") and in the value box, pick your current Actual Amount node.

    Now any time Associated Budget changes, the Actual Amount will change too.

    Rules are smart so they will know to updated only the sibling Actual Amount in the repeating context without affecting others. Note that you will have to make sure that initially both fields contain the same value.

     ==============

    Actually, now that I think of it, there is an even easier way of doing it with default values, aka "calculations". Simply double-click on Actual Amount, click on "Fx" button next to the Value, "Insert Field or Group" and pick Associated Budget. This way you get the same fuctionality without having to worry about the initial value. In general, calculations should always be used before rules since they are simpler to use (but les powerful - you cannot do conditionals likes rules can).

    Hope I didn't make this too confusing!

    David Airapetyan / Software Services Architect
    Qdabra® Software / 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.