Shrinking drop-down list in a repeating table
This InfoPath demo is the completed solution for recipe 116 of InfoPath 2013 Cookbook in which items are removed from a drop-down list box as the items are selected and added to rows of a repeating table on an InfoPath 2013 form.
In recipe 116 of InfoPath 2013 Cookbook you will learn how to create a drop-down list box from which items are removed as they are selected and added to rows of a repeating table on an InfoPath 2013 form.
Get more solutions from InfoPath 2013 Cookbook which is available on Amazon.com
Watch the next InfoPath demo: Limit a multi-select list box to a maximum of 3 selected items
InfoPath demo video transcript:
Here I'm in SharePoint 2013 where I've already published an InfoPath form template to this SharePoint form library. So if I click new document to add a new form, you'll see that as soon as the InfoPath form opens, it will display this repeating table control on it that contains a drop-down list box.
If I open this drop-down list box, you'll see that it currently contains 4 items. These items are coming from an XML file, but you can use any other type of external data source to populate this drop-down list box, for example a SharePoint list.
I'll go ahead and select an item, and then add a new row to the repeating table. And then when I open this drop-down list box, you'll now see that the drop-down list box contains 3 items excluding the item that I already selected in the first drop-down list box.
I can go ahead and select a second item, and again add a new row. And then now the drop-down list box will contain 2 items. So as I continue to add rows and select items, you'll see that the drop-down list box will contain less and less items until I don't have any more items which I can select, upon which you'll see that the Insert item on the repeating table will disappear, so I cannot add any rows more to the repeating table.
But what I still can do is... I can delete a row, for instance Brooks. And then you'll see that once the row has been deleted, the Insert item command will appear again, so I can add a row again to the repeating table, and then select Brooks here.
Another way of swapping items is to first select an empty item, for instance here. And then the item will appear in the other drop-down list boxes, so I can then move this one up to the first drop-down list box. Like that.
Related InfoPath Demo Videos:
- Populate a drop-down list box with dates excluding weekends
- Limit the amount of lines in a multi-line text box
- Limit a multi-select list box to a maximum of 3 selected items
- Auto-populate a drop-down list box with past and future dates
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.