INFOPATH FORMS FOR OUTLOOK, SHAREPOINT, OR THE WEB GINI COURTER, TRIAD CONSULTING Like most people, you probably fill out business forms on a regular basis, including expense reports, time cards, surveys, or insurance forms. You may even be responsible for designing, distributing, and maintaining these forms in your organization. You can use Microsoft Office InfoPath to design and fill out electronic forms. BEST PRACTICES FOR DESIGNING FORMS The following list describes some considerations to keep in mind when you convert paper forms to InfoPath form templates. Use layout tables to organize sections of the form. You should organize your form so that people who fill it out can move through the form in a logical manner. In InfoPath, you can use layout tables to organize controls, to separate one section from another, and to hold logos and other graphics. Using layout tables gives you the added benefit of being able to easily align text boxes, check boxes, and other elements so that your form template looks professional and polished. In the following example, a layout table is used to organize text boxes inside a section on a form template. This layout table has two rows. There are three columns in the second row. The center column is used only for spacing purposes. Consider solutions for optional information. Paper forms often contain sections that are reserved for specific categories of users. For example, a form might contain a "For administrative use only" section that is intended to be filled out by your personnel and not by the customer. In InfoPath, there are a number of ways to accommodate this type of optional information. One of the best ways is to use an optional section, which is a control that contains other controls but does not appear on the form unless the user chooses to add it (or based on the user s permissions). In this example the status report form template includes an optional Notes
section. Users who want to add supplementary notes can insert the optional section. Everybody else can leave the section hidden. You can also use conditional formatting to hide certain fields unless a specific condition is met in the form for example, you can hide a certain set of fields until the user enables a check box. Use repeating tables instead of regular tables. Repeating tables save space and offer your users an extra degree of flexibility when they fill out your form. When you use repeating tables, your form template doesn't display extra rows when the user first opens it. Instead, users typically see just one row and only add more if they need them. Determine data needs. Before you create your form, decide what ultimately needs to happen to the data that users will enter into the form. By thinking through your data needs up-front, you can determine how to distribute your form template. For example, if users need to be able to quickly send form data back and forth, and you don't need to reuse the data, then you may want to publish your form template as an e-mail message. You can store completed forms in an InfoPath Forms Folder in your Inbox. If other people need to access and share the form data, then you may want to store collections of related InfoPath forms in libraries on a server running Microsoft Windows SharePoint Services. If users need to access the form data in other business applications or systems, such as expense reporting or accounting applications, then you may want to store the data in corporate databases. (This will require support from your IT Department to create a web service.) DISTRIBUTING AND SUBMITTING FORMS You can distribute forms by email, using SharePoint, or by posting the form in a network folder. When you create a form you can specify a submit action: what happens when a user finishes filling out a form and clicks the Submit button. USING OUTLOOK You can distribute form templates to users by publishing the template to a list of e-mail message recipients. Similarly, you can design a form template so that users can submit completed forms in an e-mail message to a specified email address. In Outlook 2007 and 2010 users can additionally open, fill out, and submit InfoPath forms as e-mail messages. They can also reply to or forward the form in an e-mail message, just as they can with any other e-mail message. In their Inbox, users can store collections of related forms in a dedicated Forms folder. By displaying form data in columns in the folder, users can quickly group, filter, and sort the data in their forms. www.triadconsulting.com TRIAD Consulting, LLC Page 2
USING WINDOWS SHAREPOINT SERVICES You can publish form templates directly to a library on a server that is running Windows SharePoint Services. This enables related forms to be stored in a single, convenient location. For example, a sales team can use a SharePoint site as a place to fill out, save, and view data from sales report forms. In the library, users can fill out forms that are based on your form template, export the data from completed forms to Excel, or merge the data from several forms into one form. CREATING A NEW FORM TEMPLATE There are several ways to create a new form. You can: Use a sample form template and customize it to your needs. Design your own form template. Import a Word or Excel document that you currently use as to print paper forms. CUSTOMIZING A SAMPLE FORM TEMPLATE InfoPath comes with built-in templates; more templates are available as free downloads from the Microsoft site. To customize a sample template: 1. On the File menu, choose Design a Form Template. 2. Under Open a form template, choose Customize a Sample. 3. Under Customize a Sample, double-click the form template that you want to customize. Don t start with a sample template unless it comes close to meeting your needs. When you customize a sample, you give up some design functionality. You cannot modify existing fields or groups in the data source. Depending on the sample form, you might not be able to add fields or groups to part of the data source. DESIGNING YOUR OWN FORM TEMPLATE FROM SCRATCH When you design a form, the Design Tasks task pane shows you the steps needed to create and publish a form. LAYOUT Before you begin designing a new, blank form template, determine how you want the form template to be laid out. If you are having trouble envisioning a layout, first try sketching your ideas on paper. After you have a plan in mind, you can insert a predesigned table from the Layout task pane and customize it as necessary. Click Layout in the Design Tasks task pane and select a Layout Table. In addition to layout tables, you can use layout-related controls (choose Controls in the Design Tasks task pane). When you insert a layout-related control onto your form template, you are essentially inserting an empty container for storing other controls. The following table describes the controls that are most commonly used for layout purposes. www.triadconsulting.com TRIAD Consulting, LLC Page 3
Control Description Section A control that contains other controls. For example, you might use a section to group a set of text boxes that are used to collect contact information from users. Optional section A control that contains other controls but does not appear on the form unless the user chooses to add it. Repeating control A control, such as a repeating section or repeating table that lets users expand the contents of a form when it is filled out and display only the necessary number of entries in a series. For example, you can use a repeating table to collect itemized expenses in an expense report. CONTROLS When filling out forms, users enter information by typing in text boxes, choosing items from a list, selecting check boxes, and performing other actions. Text boxes, lists, and other form objects that users interact with are called controls. You use controls to display data or choices, perform an action, or help make the form's user interface easier to read. After placing a control in your form, right click the control to set the control s properties or other options, including conditional formatting. Frequently used controls and their typical uses are described below. STANDARD CONTROLS Standard controls include the controls that you typically associate with collecting and displaying information. These controls include text boxes, list boxes, check boxes, and buttons. Control Icon Description Text box The most commonly used control on a form. Users can enter any type of unformatted text into a text box, such as sentences, names, numbers, dates, and times. Text boxes cannot contain formatted text. Rich text box Drop-down list box A control that can contain formatted text, including bold and italic text, and a variety of fonts, font sizes, and font colors. In addition, users can insert images, lists, and tables into a rich text box. A control that presents users with a list of choices in a box. To select an item from the list, users click an arrow to open the list of choices. The choices can come from a list that you create manually, from values in the form's data source, or from values that come from a data connection to an XML document, database, Web service, or SharePoint library or list. www.triadconsulting.com TRIAD Consulting, LLC Page 4
Combo box List box Date picker Check box Section A control that presents users with a list of choices in a box from which users select the appropriate item or type their own. The choices can come from a list that you create manually, from values in the form's data source, or from values that come from a data connection to an XML document, database, Web service, or SharePoint library or list. A control that presents users with a list of choices in a box from which users select the appropriate item. The choices can come from a list that you create manually, from values in the form's data source, or from values that come from a data connection to an XML document, database, Web service, or SharePoint library or list. A control that contains a box where users can type dates and a calendar button that allows users to select a date. A control that allows users to set yes/no or true/false values by adding or removing a check mark from a small square box. A control that is a container for other controls. Sections can include any of the controls listed in the Controls task pane, including other sections. REPEATING AND OPTIONAL CONTROLS Repeating and optional controls include list controls, repeating tables, repeating sections, and optional sections. These controls allow users to insert list items, rows, record sets, and optional information when filling out a form. Control Icon Description Optional section A control that is a container for other controls and is useful for including extra information that is not necessary for all users to fill out. When filling out a form that includes an optional section, users can choose whether to include the optional section on the form. Repeating section Repeating table Plain list A control that is a container for other controls and is useful for presenting record-based data, such as employee database records. When filling out the form that includes a repeating section, users can add additional occurrences of the repeating section. A control that displays repeating information in a tabular structure. Each item appears in a new row in the repeating table. When filling out a form, users can add or delete rows in a repeating table as necessary. Repeating tables can contain other controls. A control that allows users to add or delete list items in a form as necessary. Plain list controls are a good way to include simple text that repeats, such as a list of attendee names in a meeting request form template. FILE AND PICTURE CONTROLS You can design your form template so that users can insert file attachments or pictures when they fill out forms that are based on your form template. In addition, users who fill out InfoPath forms on a Tablet PC benefit from a special ink picture control that lets them create and save ink drawings. www.triadconsulting.com TRIAD Consulting, LLC Page 5
Control Icon Description File attachment Picture A control that allows users to attach files to their forms. Each file attachment control permits one file to be attached, and you can restrict the file type, if necessary. If your users want to attach multiple files, you can insert the file attachment control inside a repeating control. A control that can be included on a form template as a static element, such as a title or a background, or can allow users to insert a picture as part of the form. Picture controls can store the image on the form itself or store an address (URL (Uniform Resource Locator (URL): An address that specifies a protocol (such as HTTP or FTP) and a location of an object, document, World Wide Web page, or other destination on the Internet or an intranet, for example: http://www.microsoft.com/.)) that points to the saved location of the picture. ADVANCED CONTROLS Advanced controls are used less frequently than standard controls or only in special circumstances. Control Icon Description Hyperlink A control that can be used to link to a URL. For example, a form template that shows information about a list of products can include hyperlinks to product information Web pages. Hyperlink controls can point to any Web server on either an intranet or the Internet. Expression box A read-only text control. You can use expression boxes to display read-only text, display the value of another control on the form, or create formulas based on XPath (XML Path Language (XPath): A language used to address parts of an XML document. XPath also provides basic facilities for manipulation of strings, numbers, and Booleans.) expressions. REMOVING A CONTROL To remove a control from a form template, you select the control and then press the DELETE key. When you remove a control, the field that is bound to that control remains in the data source. However, a form that is based on this form template will not show the data stored in this field. To display the data, you bind a control to the field. If you want to bind a different control to the field, instead of deleting the control, you can change the control to a different type. You do this by rightclicking the control, clicking Change To, and then clicking one of the choices on the menu. The menu displays only the types of controls that can be bound to this type of field. DATA SOURCE Almost all of the controls on an InfoPath form are bound (bind: To connect a control to a field or group in the www.triadconsulting.com TRIAD Consulting, LLC Page 6
data source so that data entered into the control is saved. When a control is unbound, it is not connected to a field or group, and so data entered into the control will not be saved.) to the form template's data source. If a control is not bound to the data source, or if it is bound incorrectly, the information that is entered into that control cannot be saved properly in the form s XML file. In this example, the form designer inserted a Last Name text box on the form template. The text box is bound to the lastname field in the form template's data source. When you design an InfoPath form template, you can choose to have the fields in the data source created automatically each time you insert a control, or you can manually bind each control to an existing field yourself. You can also create a form starting with a data source description file (an XML schema). TIP: TO SWITCH BETWEEN AUTOMATICALLY CREATING THE DATA SOURCE AND BINDING THE CONTROLS TO AN EXISTING FIELD OR GROUP, USE THE AUTOMATICALLY CREATE DATA SOURCE CHECK BOX IN THE CONTROLS TASK PANE. To modify a field in the data source (for example, to provide a default value), click the down arrow on the field in the Data Source task pane and choose Properties. Use the Move, Move Up, and Move Down commands to rearrange or group the fields in the data source. VIEWS When your form is complete, choose Views from the Design Tasks task pane to create additional views for example, a print view that includes a page break, or different views for different user roles. DESIGN CHECKER Use the Design Checker to make sure that your completed form template is XML compatible. PUBLISH FORM TEMPLATE This is the final step of form creation. Publish your form to a SharePoint server, a list of email recipients, or a network location. www.triadconsulting.com TRIAD Consulting, LLC Page 7
IMPORTING A FORM FROM WORD OR EXCEL 1. In the Design a Form Template dialog box click Import or choose File then Import a Form to open the Import a Form dialog box. 2. Choose Word or Excel. Click Next. 3. Select the file you want to import. (Your original file will not be changed.) 4. Click the Options button and set the options for how controls and open text areas in the original Word or Excel form will be imported. Click OK. 5. Click Finish to import the form into InfoPath. PUBLISHING AN INFOPATH FORM TO A SERVER RUNNING INFOPATH FORMS SERVICES One way to distribute a form to other people in your organization is to publish it to a SharePoint Server library. This allows team members to fill out and save the form whether or not they have InfoPath installed on their computers. Follow these steps: TO PUBLISH A FORM TEMPLATE TO A LIBRARY 1. On the File menu, click Publish. 2. On the second page of the Publishing Wizard, click To a SharePoint server with or without InfoPath Forms Services, and then click Next. 3. In the Enter the location of your SharePoint or InfoPath Forms Services site box, type the name of your site, and then click Next. 4. On the next page of the wizard, ensure that Enable this form to be filled out by using a browser is checked at the top of the page. 5. Click Document Library, and then click Next. 6. If this is a new form, click Create a new document library, and then click Next. In the Name box, type the library name and then click Next. If you are republishing a form, choose the document library. 7. Click Add to add a SharePoint column. 8. In the Select a Field or Group dialog box, select the fields you wish to promote to SharePoint. 9. In the Column name box, replace any field names you wish with user-friendly names for SharePoint. Click OK. 10. Repeat steps 7, 8, and 9 to add more columns to the document library. When finished, click Next. 11. To complete the wizard, click Publish. The final page of the wizard indicates that the form was successfully published. This page contains a link to preview the form in the default browser. TO OPEN THE PUBLISHED FORM 1. Browse to the SharePoint Server library. 2. On the document library toolbar, click New. www.triadconsulting.com TRIAD Consulting, LLC Page 8