none
show distinct items in list view RRS feed

  • Question

  • hi,

    i have a list in below format.

    1   district1    state1

    1   district2    state1

    1   district3    state2

    1   district4    state3

    1   district5    state2

    i need to show the unique state names in a page , on click of state name it should navigate to another page where it should show all district under that state .

    any ideas ?
    • Edited by Nikhil0041 Monday, January 16, 2017 10:30 AM
    Monday, January 16, 2017 10:29 AM

All replies

  • Hi Nikhil,

    There is one option to achieve this easily.

    Crete two lists

    1. States Names

    2. Districts with state name as lookup from above list.

    By doing this - you will achieve two things

    1. You will get a screen where you will see only distinct states - default view of States List

    2. Add small script on allitems.aspx page of States list - which will update hyperlink of every item - to navigate to a separate page with statename as query string parameter.

    Create a page - add Districts listview webpart on that page - add another Filter webpart - read Query string paramter and apply filter to Districts List view webpart. - So this will help you to see Districts of selected/clicked States.

    sample url of your page https://nikhil.com/sites/nikhil1/pages/districts.aspx?statename=State1

    Here is more details about connecting filter webpart with list view webpart.

    Hope this helps.


    Regards Sarvesh Shinde SharePoint Developer, India

    Monday, January 16, 2017 11:39 AM
  • Hi

    what about a view customized in sharepoint designer, in which you group based on State column .

    You have the possibility to collapse or not  for each state by click


    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.


    Monday, January 16, 2017 11:42 AM