Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

SharePoint Rolodex Using the Query String Filter Web Part

Craig Condon

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:

  1. Create an “Index” field in the list or library.
  2. Add a Query String Filter Web Part, a Content Editor Web Part, and the web part for the list to a site page.
  3. Add code to the Content Editor Web Part with links that reload the page with the query string value.
  4. 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):

=LEFT([Title],1)

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.
Conclusion

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.

5 Comments. Leave new

Can you please post the code for the “add code to the Content Editor Web Part”? The image is not visible.

Hmm, I’m not having any issues loading the image. In the meantime, here’s a snippet of the code:


<a href="/sites/customers/default.aspx?index=A">A</a>
<!--fill in the rest-->
<a href="/sites/customers/default.aspx?index=Z">Z</a>
   ||   
<a href="/sites/customers/default.aspx?index=0">0</a>
<!--fill in the rest-->
<a href="/sites/customers/default.aspx?index=9">9</a>
   ||   
< href="/sites/customers/default.aspx">clear filter</a>

Hope that helps.

can you please tell me how to create the same SharePoint 2013

I am not able to do it .. in the new version..

Craig Condon
July 21, 2014 9:39 am

I have not had a chance to try it out in 2013 yet. When I do, I’ll post my findings.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

\\\