What’s the difference between a form and a form template?
We’ve had some people ask us about the difference between a form and a form template. It’s easy to confuse the two–partly because people often expect them to be the same thing, and partly because of how we use the terms in InfoPath.
When you design a new form in InfoPath–say, a status report for your department to fill out, you’re actually creating a form template. This is the file that defines the data structure, appearance, and behavior of the forms that your users fill out. The form template usually has an .xsn file name extension, and actually consists of several files that have been compressed into one, including one or more XML schemas, an XSLT file for each view in the form, an XML file for the default data, script files or managed code assemblies, and a form definition file (manifest.xsf), which contains information about the components of the form, including how it looks and acts, deployment settings, and data connections.
After you finish designing the form template, you can publish it so the people in your department can start filling in their status reports. As you might’ve guessed, each of their status reports is a form. That form is just an XML file that contains the data (and only the data) that’s been entered into the form. All the other stuff that makes up the form–the graphical interface, the validation, the data connections–is provided by the form template. Which means that whenever you open a form in InfoPath, that form needs to locate and use the form template to function properly. (Otherwise, you’d just be looking at plain XML data.) To link the form to the form template, InfoPath includes a processing instruction in each form that points to the associated form template. (For those of you wondering how this works when you’re offline: When you use a form, the form template is cached on your computer.)
One last note, for the pathologically curious: For a variety reasons, we often use the term “form” to mean both forms and form templates. For example, there’s a Fill Out a Form command and a Design a Form command on the File menu. We tried using “form template” whenever discussing the .xsn file, but we discovered that the term actually confused more people than it helped. It turns out that people were much more likely to think of what they were designing as a form, instead of a form template. This stems most likely from paper forms, which are always called “forms,” whether they’re being designed, printed, or filled out. Also, in some cases, it was hard to draw a distinction between forms and form templates: Should the Form Options dialog box be titled Form Template Options, because you access it in design mode, or Form Options, because the choices affect how the forms will look? Finally, a hard and fast rule can make things pretty awkward: Instead of the Design This Form command, for example, we’d have Design the Form Template Associated With This Form.