Creating the Business Card Request InfoPath Form
- by JKenderdine
Business Card Request Demo Files Back in January I spoke at SharePoint Saturday Virginia Beach about InfoPath forms and Web Part deployment. Below is some of the information and details regarding the form I created for the session. There are many blogs and Microsoft articles on how to create a basic form so I won’t repeat that information here. This blog will just explain a few of the options I chose when creating the solutions for SPS Virginia Beach. The above link contains the zipped package files of the two InfoPath forms(no code solution and coded solution), the list template for the Location list I used, and the PowerPoint deck. If you plan to use these templates, you will need to update the forms to work within your own environments (change data connections, code links, etc.). Also, you must have the SharePoint Enterprise version, with InfoPath Services configured in order to use the Web Browser enabled forms. So what are the requirements for this template? Business Card Request Form Template Design Plan: Gather user information and requirements for card Pull in as much user information as possible. Use data from the user profile web services as a data source Show and hide fields as necessary for requirements Create multiple views – one for those submitting the form and Another view for the executive assistants placing the orders. Browser based form integrated into SharePoint team site Submitted directly to form library The base form was created using the blank template. The table and rows were added using Insert tab and selecting Custom Table. The use of tables is a great way to make sure everything lines up. You do have to split the tables from time to time. If you’ve ever split cells and then tried to re-align one to find that you impacted the others, you know why. Here is what the base form looks like in InfoPath. Show and hide fields as necessary for requirements You will notice I also used Sections within the form. These show or hide depending on options selected or whether or not fields are blank. This is a great way to prevent your users from feeling overwhelmed with a large form (this one wouldn’t apply). Although not used in this one, you can also use various views with a tab interface. I’ll show that in another post. Gather user information and requirements for card Pull in as much user information as possible. Use data from the user profile web services as a data source Utilizing rules you can load data when the form initiates (Data tab, Form Load). Anything you can automate is always appreciated by the user as that is data they don’t have to enter. For example, loading their user id or other user information on load: Always keep in mind though how much data you load and the method for loading that data (through rules, code, etc.). They have an impact on form performance. The form will take longer to load if you bring in a ton of data from external sources. Laura Rogers has a great blog post on using the User Information List to load user information. If the user has logged into SharePoint, then this can be used quite effectively and without a huge performance hit. What I have found is that using the User Profile service via code behind or the Web Service “GetUserProfileByName” (as above) can take more time to load the user data. Just food for thought. You must add the data connection in order for the above rules to work. You can connect to the data connection through the Data tab, Data Connections or select Manage Data Connections link which appears under the main data source. The data connections can be SharePoint lists or libraries, SQL data tables, XML files, etc. Create multiple views – one for those submitting the form and Another view for the executive assistants placing the orders. You can also create multiple views for the users to enhance their experience. Once they’ve entered the information and submitted their request for business cards, they don’t really need to see the main data input screen any more. They just need to view what they entered. From the Page Design tab, select New View and give the view a name. To review the existing views, click the down arrow under View: The ReviewView shows just what the user needs and nothing more: Once you have everything configured, the form should be tested within a Test SharePoint environment before final deployment to production. This validates you don’t have any rules or code that could impact the server negatively. Submitted directly to form library You will need to know the form library that you will be submitting to when publishing the template. Configure the Submit data connection to connect to this library. There is already one configured in the sample, but it will need to be updated to your environment prior to publishing. The Design template is different from the Published template. While both have the .XSN extension, the published template contains all the “package” information for the form. The published form is what is loaded into Central Admin, not the design template. Browser based form integrated into SharePoint team site In Central Admin, under General Settings, select Manage Form Templates. Upload the published form template and Activate it to a site collection. Now it is available as a content type to select in the form library. Some documentation on publishing form templates: Technet – Manage administrator approved form templates And that’s all our base requirements. Hope this helps to give a good start.