How to create a 'hidden' field in InfoPath

by S.Y.M. Wong-A-Ton

Learn how to add a field to an InfoPath form template so that it exists in the InfoPath form but remains invisible to a user.

A ‘hidden’ field in InfoPath is a field that exists in the data source of the form, but that is not displayed on any view of the form. The advantage of using a ‘hidden’ field is that you can store data in the form and keep this data invisible to the user.

You can create a ‘hidden’ field on one of 2 ways:

  1. Drag-and-drop a text box control onto the InfoPath form template’s view. If you have not changed the default settings when you first installed InfoPath, this action will automatically add a field to the Main data source of the InfoPath form. Rename the text box control if you wish and then delete it from the view. It will still be present in the Main data source when you delete it from the view, but will be ‘hidden’ from the user.
  2. Go to the Data Source task pane, right-click the myFields (root) node, and then click Add from the context menu to add a field. The field will be present in the Main data source, but not present on any view, so effectively ‘hidden’.

A good example of a ’hidden’ field is when using helper fields in InfoPath forms as described in Master/detail across views.

May 29, 2009 Update:
I wrote and published an article showing how to create a ‘hidden’ field in a repeating table in InfoPath. And here are two practical examples of using ‘hidden’ fields in InfoPath:

 Subscribe (RSS | Email)

Related Posts

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

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 of S.Y.M. Wong-A-Ton. Usage of 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, S.Y.M. Wong-A-Ton.

Working with InfoPath