SharePoint Rolodex Using the Query String Filter Web Part
Navigating through a list or library with dozens or hundreds of items or folders can be a tedious task. There are a few ways to make it easier to find the information you are looking for. One unique way is to build a rolodex to filter the list items conveniently.
The rolodex is configured by using a Query String Web Part and Content Editor Web Part to filter a list or library. The high-level steps to accomplish this are:
- Create an “Index” field in the list or library.
- Add a Query String Filter Web Part, a Content Editor Web Part, and the web part for the list to a site page.
- Add code to the Content Editor Web Part with links that reload the page with the query string value.
- Configure the Query String Filter Web Part to send data to the list web part.
I’ll use a Customers list for this example.
Create an “Index” field
The first step is to create a column in the Customers list that will hold the first letter of the Customer name. This column, which I named “Index”, is a calculated column with the formula shown below (assuming the customer name is in the Title field):
A snapshot of your data might look something like this:
Add web parts to the page
The next step is to add a Content Editor Web Part, a Query String Filter Web Part, and the Customer list web part to a site page.
Add code to the Content Editor Web Part
Edit the HTML source of the Content Editor Web Part and add the code shown below. Replace the URL with whatever the location of your page is. Notice the “index” query string parameter – we’ll touch on that next.
The result should look something like this:
Configure the Query String Filter web part
Finally, configure the Query String Filter web part. Set the Query String Parameter Name field to “index”, which represents the query string parameter in the URLs in the HTML code above.
Connect the Query String Filter web part to the Customers list.
On the “Configure Connection” tab, select the Index field from the dropdown list and then click Finish.
That’s all there is to it. Now, when you click on a letter or number, it will filter the Customers list, as shown below where the letter “D” was clicked.
As a side note, the “Index” field in a list is a great way to create a “group by” view on your list.