# Filtering in AutoComplete

Learn how to filter with Wijmo's AutoComplete in this tutorial

## Content


The __AutoComplete__ control takes control of its source collectionView filtering in order to show only items that match the user input.

If you want to keep control of the filter, set the __itemsSource__ property to your filtered CollectionView's __items__ property. AutoComplete creates a new CollectionView for its internal use, and the original filtering in the CollectionView is preserved.

In the example below, AutoComplete uses a filtered CollectionView as its itemsSource. The filter remains active while searching for items as the user types. 

##### HTML

```html
 <div id="theAutoComplete"></div>
```

##### Javascript

```javascript
import * as wijmo from '@mescius/wijmo';
import * as input from '@mescius/wijmo.input';
import { getData } from './data';

function init() {
    // create a filtered CollectionView to use as a data source
    let view = new wijmo.CollectionView(getData(), {
        filter: theFilterFunction
		});
		
    // create the AutoComplete using the CollectionView's items as a source
    let theAutoComplete = new input.AutoComplete('#theAutoComplete', {
        displayMemberPath: 'country',
        itemsSource: view.items
		});
				
    // our filter function
    function theFilterFunction(item) {
        return item.popk > 50000;
		}	
		
}
```



