InfoPath Q&A: How do I copy or transfer data between InfoPath forms?

Filed under: InfoPath 2007

This post discusses two possible solutions for a reader's question about how to automatically transfer or copy data entered into one InfoPath form to the same fields in a second InfoPath form.


Duyen wrote:


I am currently creating forms using Infopath 2007 which will eventually get uploaded into Sharepoint.

Is it possible for the information in certain fields in one form to be automatically updated in the same field in another form?

i.e Two forms are required to be filled out. The first form is completed which then triggers the second form to open up. There will fields on the second form which ask for the same information i.e Name, address, etc.
Is there anyway to make it so that this information gets put in automatically into the second form?


Hi Duyen,

Thanks for your question. As I see it, there are two possible solutions to your problem, but each solution has its own issues.

Solution 1:
Passing data between two separate InfoPath forms is not an easy task. If you’re working with InfoPath browser forms, you’d have to write code in the first InfoPath form to open the second InfoPath browser form with query string parameters in its URL for the values you want to pass, and then in the Loading event of the second InfoPath form, read those values in and populate the fields of the second InfoPath form.

The issues with this solution is that you’ll hit a limit as to how much data you can pass in the query string, and all data passed in the query string will be in clear text.

Solution 2:
A second (codeless) option would be to create one InfoPath form template (instead of two InfoPath form templates) that has two Views; one for each User Interface you require.

The Views would then share the Main data source of the InfoPath form template, so that any data entered in fields that have been placed on both Views, would be displayed on both Views.

The issues you’ll have with this solution is that you’ll need a way to switch between Views, that is, go from the first to the second View. You could for example maintain an extra field in the data source to keep track of whether the form has been submitted, then add rules to check the value of this field when the form is opened, and if the value has been set, switch to display the second view. Or if you don’t want to submit and open the form, you could just create a button that the user can click on to switch from the first to the second View. Another potential issue is that you may want the user to be able to view each filled out View separately? That is, allow the user to see the first View without having the option to see the second View.

While not conclusive, I still hope these two ideas for solutions will get you a bit further in coming up with a suitable solution for your scenario.


Related Posts


Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author.