In the past months/year, I’ve written several articles on how to retrieve field values in InfoPath, but the information has been buried, so I’ve decided to summarize the articles here in the hope that they’ll be easier for you to find:
- You can use the Value property of an XPathNavigator object to programmatically retrieve the value of a field. For a code sample on how to do this, see How do I retrieve the value of an InfoPath field through code? or Programmatically retrieve the value of an InfoPath form field using .NET code.
- If you want to programmatically retrieve the value of a Rich Text Box in InfoPath, you can use the method described in How to programmatically get or set the XHTML code of a Rich Text field in InfoPath 2007.
- If you want to programmatically retrieve all of the values of the fields in an InfoPath form all at once and store them in an object, you can use XML deserialization as described in How to deserialize an InfoPath form into a C# or Visual Basic object.
And finally, if you do not want to write code, you can use the Set a field’s value Action in a Rule to retrieve the value of a field and set it as the value of another field. For an article written by Microsoft, see Automatically set a field’s value on Office Online.
Update Jan 15, 2009:
Yesterday I published an article, which explains how to retrieve a value of a field in a repeating table from another field in the same row of that repeating table using C# code in InfoPath 2007.
Update Jul 4, 2009:
I’ve also created 2 video tutorials in which I show you how to programmatically set the value of a field in InfoPath using:

Comments to this post were closed 30 days after it was published.