Join Gini von Courter for an in-depth discussion in this video Creating views, part of InfoPath 2010 Essential Training.
I've added one more section to our form since the last time you saw it. We have a wonderful form for the user, but we need a section at the bottom so that the staff who will actually create these new content areas or post these files and descriptions will be able to indicate that their work was done, or to keep notes on the work that they did. So here's the Office Use section at the bottom of the form, and it is shaded, as Office use sections often are. Now we could type 'For office use only' on this form as you often see with paper forms; however, we don't need to.
In InfoPath 2010 we can actually ensure that the user won't even see this form section, so they won't be tempted to type in it at all, and we'll do that by using views. As you may recall from earlier, a view is simply one way to look at this data set here, one set of controls and other containers that allow a user to enter data. If I want to have different ways to view this data, I can store all of those different views in the same template.
Let's go to the Page Design tab because this is where we work with views. When we create a new form in InfoPath, it is the default view, and it is named view1--great name for it. This view is actually the complete form, and so what I'm going to do is I'm going to change the name of this view. What I'll usually say is something like all fields. This is my developer's view, so I've sometimes also called it Developers. I keep one version of the form that's my view of it in every single form that I create, because when we start to create other views each of them will simply be a variation of the total form, with all of its sections.
So I'll take the form, save it for myself, and then start deconstructing it for my users. Let's first create that form that we want the users to see that does not include this section area. I'm going to begin, because I'm here already, by doing a Ctrl+A to copy the whole view and say Ctrl+C to copy. Now I'm going to create a new view, and this is going to be the new default view. So, I could call this default, I could call this User Data Entry, and notice that I'm allowed to place spaces here.
So it begins, as every view does, with a table, but I don't want it. I'm going to delete the table, hold Ctrl and hit V, and paste my entire form in. I now have two views, and they're identical, and I can choose them here: the Developers view and the User Entry view. In the User Entry view, I do not want to have this section appear, so it's easy to take care of. I'll scroll to the bottom and delete it. Now when a user previews this in the User Entry view, notice no section at the bottom for office use only.
Now I want to create a view for the folks who are going to complete this request. So let's go back to Page Design. Let's create another new view, and I'm going to call this new view OEC Use, Office of Electronic Communications. Once again here's my table. I don't want it, and I'm simply going to paste this in. Now, if there was any information on this form that the OEC folks didn't need, for example, the instructions on the top on how to use a form that they still need to provide, I can delete that, and indeed I can actually delete this whole row.
They don't need to have that kind of instruction. And it may be that as I scroll down I would find other information that they simply didn't need, but this appears to be approximately the view that they would require. So now if I go back to Preview, what I'll find is the User Entry view that has instructions, the Developers view which has everything, and the OEC Use view that does not contain those instructions. There's one other view I'd like to provide.
I've allowed users to suggest category and department interest information, but the folks in our OEC department are perfectly capable of abstracting that out of the post description. So I'm going to provide an express form for people who do not feel a need to provide post category information, department info information, or news information. So those three sections I won't need. Additionally, they won't require this OEC, Office of Electronic Communications Use Only section.
Now, this is where we begin to want to make sure that we have a really good process around this. If I begin with the OEC Use section, I'll have to remember to delete this as well, and also I will forget, perhaps, that the OEC Use section doesn't include basic information for users. So my discipline is that I will always go back to the entire set. This is everything that could possibly be here, the master developers Form, and create a new view from here that's called Express Request.
Delete the table. I still have the same stuff on the clipboard that I had before, everything. I'm going to create my Express view, Express Request, my Post, but deleting this repeating table, this repeating table, this entire section, this heading, and all of the extra space. Now again, I don't want my user to see this section either, so we'll simply delete it.
Cool. Let's go to see how it looks. Home > Preview. So here's my Express request. The Preview will always open with whatever I just created. Nice and short, but if a user wants to do something more complex, there is the detailed user entry form with all of these additional fields. Very slick.
- Creating a template from scratch
- Understanding and modifying data sources
- Formatting a template
- Inserting text controls, data pickers, and check boxes
- Catching incorrect or missing data
- Using tables and sections for repeating data
- Calculating a value with form data
- Checking spelling and testing a template
- Creating views
- Developing data connections to SharePoint lists and XML files
- Understanding publishing options for InfoPath templates
- Importing Excel and Word forms