Pages

Monday, June 18, 2012

Populate Drop Down Lists in InfoPath from a SharePoint List

Drop Down Lists in an InfoPath Form Connected to a SharePoint List


Here is the good, the bad and the downright ugly of the drop down list function in InfoPath.

Let's start ugly.

Here is a drop down list from a SharePoint List.  This is simply a list of 100 recent forms:

There is a form missing from the list - how can this happen?  Also, how many items should you show in the Drop Down List.



Firstly, how do you control how many items will appear in this drop down list?  You will need to create a view in SharePoint that has filters on it - either filter the items in the list by date, author, not older than 30 days, not approved (you set the filter criteria based on your needs) or organise the SharePoint view to show the list in batches.  Filtering can also done within InfoPath itself.  Note that you have the list showing, for example, the first 100 items, then this list will only show the first 100 items, even if the SharePoint list view allows you to navigate through all the items stored in the list 100 at a time. That is the easy part.

But where is the missing form?  You will see that it is not missing as such, just that the field from SharePoint - which happens to be used to create the drop down list in InfoPath - has been left blank. 

Either make the field compulsory within the form, or set the list up so that this field cannot be blank by combining values that are automatically created with the form (Date, modified date, user, etc) in a title field.