SharePoint 2013 BCS using a comparison filter on a System.Nullable field

In this SharePoint BSC tutorial, we explore External Content Type how to apply a comparison filter on a System.Nullable<System.Int32> in BCS. I’m creating an External Content Type with SQL Store procedure in SharePoint 2013. I have one input parameters of the type System.Nullable<System.Int32> and I’d like to add filters of the type Comparison to these input parameters.

Filters in BCS are very handy, and often necessary, for reducing the amount of items when working with External Data, such as an External Data Column based on an External Content Type.

A sample input parameter for a Read List operation,may look like this:

SharePoint 2013 bcs nullable filter
SharePoint 2013 bcs nullable filter

If you want to add a Comparison filter for this input parameter, you would probably set it up like this:

SharePoint 2013 bcs tutorial
SharePoint 2013 bcs tutorial

When you click OK, you would see an Error message in the Errors and Warning list at the bottom of the page.

It seems like SharePoint BCS is unable to cope with Nullable Int .NET data types, which would be odd, as they have been around in the .NET Framework since version 2.0.

It shows an Error message:

“The filter data type Sytem.Nullable<System.Int32> does not match data type System.Int32 on the data source element [[ElementName]].


The solution is to set the Filter Field property of the Filter to <<none>>. Since the Filter Configuration dialog is started from the Element properties panel, the Element to filter is still linked to this filter.

SharePoint 2013 bcs error
SharePoint 2013 bcs error

Press OK to close the Dialog and press Finish to close the Read List dialog. Save your changes to ECTs.

We configure comparison filter External Content Type ’ to Business data List.

Step 1: Navigate to your SharePoint 2013 site.

Step 2: From this page select the Site Actions | Edit Page.

Edit the page, go to the “Insert” tab in the ribbon and click the “Web Part” option. In the “Web Parts” picker area, go to the “Business data” category, select the “Business data List” Web Part and press the “Add button”.

Step 3:

SharePoint 2013 bcs tutorial
SharePoint 2013 bcs tutorial

You may like following SharePoint BCS tutorials:

I hope its help full….

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.