Join Gini von Courter for an in-depth discussion in this video Using repeating tables, part of InfoPath 2013 Essential Training.
There are several categories of data in our form that might appear more than once if we make a provision for it. This movie is about how we deal with repeating data. Let me give you an example. When a user asks for a post, we are asking them what category it goes in. And it could be that it only falls into one category; it might be about travel for example, or it might be about festivals or staff meetings. But it could be about more than one thing; travel and tourism, staff meetings and morale.
If we want to allow more than one category, I have controls that will support that. You'll find those controls with the word Repeating in them. Repeating Table for example; Repeating Section are two of them. But before I can use those particular types of containers, I have to change my data source to allow my data to collect multiple instances of the categories. Now you might wonder why don't we use the multi-select list? Well if I only had one field I would, but I actually have three.
And so the multi-select list works fine when I want to select multiple values in one field. But I actually want this entire section to repeat. So I need a container that repeats. Fortunately, InfoPath has controls that repeat both Repeating Tables and Repeating Sections and they're incredibly powerful to use. We have to start though, not over here in the form, but over here. So I'm going to select PostCategories, open its Properties and say this group allows repeating.
I am going to leave that here for a minute so you can make sure that you absorb what it is we're doing. I am not saying PostCategory repeat and each of these fields repeat, I am saying this entire group repeats over and over again, and click OK. Notice it has a new icon, this little down arrow. It looks like a dropdown list that you'd open and notice now that I have a section that says Oops! I can't even deal with this kind of data, because this was a section that wasn't a repeating section but a regular section.
That's okay, it's calling out that it's got a problem, let's go ahead and delete it. So we'll need to put a new section or a new type of container in here. We have the choice for a Repeating Table or a Repeating Section. Now if I choose from here you'll remember that the next thing I'll have to do is change the binding. So I am going to make a choice actually to use drag and drop. I am going to create a little more space to move in, just press Enter one more time so I have nice big target to hit. Whether I have a Repeating Table or a Repeating Section depends on the kind of layout I want.
If all of these fields will fit all the way across in a single rule, I like the idea of a table. If on the other hand I had really large fields or a large number of them, I'm going to be pushed to use a section. So let's go ahead and drag our new repeating data over here. I didn't right-drag, I just dragged and InfoPath says whoa! What do you want to do with this, because I have three choices; a Repeating Table, a Repeating Section, that has the control dropped into it, or a Repeating Section that creates the possibility for me to place the controls in.
I want a Repeating Table, and that's what it's looks like, pretty amazing. Now the first thing I have is a PostCategory that's that field, a PostCategoryNote that's this field. And finally I have a checkbox about whether this is Primary or not. It's got a lot of space, because it has a long name. Notice that my table across the top has headings and all of this is editable. I can simply get rid of the words PostCategoryIs and ask if this is primary. I have space at the top of this form to provide user instructions, and is this the Primary Category? So notice I can just go ahead and tighten all these things up and when I do I'm winning back space for the things like the Note.
We already know how to deal with this text box so that can go multi-line and we can work with that later. But right now this is how I can create a Repeating Table. Let's go see how this table looks. I am going to click Preview and I am going to Enter a category. We can make this a dropdown list if we want; I only need to do it once. But let's say the Category here is Travel, and a Note, this is just a Test and I am going to make this Primary. Then if I want to add another item, I click Insert item; and this is Tourism and my Note is a Test and it's not primary, so I just leave that. That works well.
I can continue adding as many items as I wish here. Now Insert item is interesting, but this is all about categories. So let's close this Preview, let's go back and the Repeating Table itself has Properties. So I select it, right-click, catch the Repeating Table Properties and here are my choices. First, we've got Binding and the reason the binding is here in the Properties of the Table is that we are going to bind to a group. So I can change my binding here if I need to.
I can also allow users to insert and delete rows. Now I don't necessarily need to do that. I could have a Repeating Table that had a specific number of rows in it or I didn't want users to be able to delete rows. I have lots of choices about what I do here and I can customize the commands for Insert, Insert Above; Insert Below and so on. And down below where we have that Insert item Hyperlink, I can change this to say Insert details for another category. I've lots of room because this actually sits underneath the table.
Let's say OK and go back to Preview and take a look at what we have. Insert details for another category, right there. But notice this arrow out here when I click and this is where we see Insert Categories, before, after, or to remove an item. I also have Cut Copy and Paste if I need it once I've cut or copied something. So again, this Repeating Table, a really significant control that I can use, I don't have to decide how many rows I need upfront, I can just say okay I'm all set.
I've set up one row and the user can add as many more as they need to. Let's do one more thing while we're still here. Let's go back and actually make a change to those properties one more time. So when we saw the commands for Insert Above and Insert Below, it actually said Insert PostCategories, but even though it says PostCategory here we're talking about Categories. So I could actually say Insert another category and rather than Insert PostCategories before, I could say Insert a category before, and that's before the selected row, Insert a category after, Remove a category.
And if I believe somebody might want to start all over again, I could simply say Remove all categories and let them start all over again from scratch. So let's say OK, let's say OK again, Preview this; Insert a category before, after, Remove a category, Remove all. So that's how those commands work. These are how the properties work so that we can make sure that our user understands exactly what they are being asked to do.
This is how you create Repeating Table and modify its Properties so that you can have repeating data in your form without creating empty row capacity for it.
- What is InfoPath?
- Creating a template from scratch
- Importing Word and Excel forms
- Creating and modifying data sources
- Adding and formatting a layout table
- Choosing a theme
- Working with form controls like date pickers and check boxes
- Using tables and sections for repeating data
- Publishing forms and templates
- Enabling digital signatures in a form