September 24, 2012

Filtering Infopath form for a SharePoint List

I'm very new to Infopath and I'm using it to build some list forms for SharePoint 2010 Enterprise.  I wanted to filter a drop-down box to just those items which I had flagged to be used in the list.  My problem was I couldn't filter on my Yes/No checkbox field because it didn't show up in the drop-down list box properties.

If I delete that data source and create a new one I could filter, but it wouldn't publish (or work right if it did publish).

I then came across this blog entry on nothingbutsharepoint.com where Toni explains (including screenshots) that I don't need to replace the data source, but instead create a new one to populate the available choices (duh!).

If you're not familiar with the process, please see that blog... for my purposes the field already exists and is in working order, just not filtered... there's also a Yes/No Checkbox on the source list.  These are the steps that I will likely miss in the future:
  1. Open the Drop-Down List Box Properties
  2. Add a new DataSource and select the source list (list of items you want to select from).
  3. Select the fields that you want to display and filter in addition to the ID field which should already be selected.
  4. Finish the wizard to get back to the properties page.
  5. Change the Value to the ID field (and Display to the appropriate display field)
  6. Click the button next to entries (looks like a directory tree) and click Filter Data... from here you can setup to filter on the filter field.