Forum Discussion

JFM_12's avatar
JFM_12
Iron Contributor
Aug 07, 2023
Solved

SharePoint List - Group items and leave one category open

Hello

Is it possible to have a list with grouping a category and leave one of the category expanded

i.E. 3 groups

- error, warning, successfull

2 groups should be shown collapsed

1 group shuld be shown expanded

The goal is to do it without programming.

Thank you

JFM_12

  • JFM_12 The accordian web part is not one of the ones available on a modern page. But you can still achieve what you want via a different method.:

     

    • Make sure you have 3 views of your list filtered for Successful, Warning and Error.
    • Then create a page and add 3 one-column sections.
    • Add  a list web part into each section, select your list then select the view to display.
    • Edit each section and select "Make this section collapsible" and select the default display, so Successful and Warning are collapsed by default and Error is exapnded.

     

     

    And this is the result:

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

9 Replies

  • JFM_12 This is not possible using SharePoint out of the box list view settings. You can either keep all groups expanded or collapsed like: 

    However the workaround suggested by Rob_Elliott using SharePoint Collapsible Sections should work for you. 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    • JFM_12's avatar
      JFM_12
      Iron Contributor
      Hi Ganeshsanap
      Thank you it does work.
      It was just a wish, that this could be implemented.
      Thank you again
      JFM_12
      • JFM_12 You're welcome, I am glad it helped you.


        Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

  • Lalit Mohan's avatar
    Lalit Mohan
    Iron Contributor

    Hi JFM_12 

    Yes, it is possible to achieve grouping in a SharePoint list and leave one category expanded without programming. SharePoint provides a simple way to do this using the "Group By" feature and a custom view. Here's how you can accomplish this:

    1. Create your SharePoint list:

      • Go to your SharePoint site.
      • Click on "Site Contents" and then "New" to create a new list.
    2. Add your list items:

      • Enter the necessary columns and data for your list items.
    3. Create a view with grouping:

      • In your list, click on the "All Items" view (or any existing view you prefer to modify).
      • Click on the "Modify View" or "Create View" button to create a new view.
      • Scroll down to the "Group By" section.
      • Choose the category column you want to group by (e.g., "Status" column for error, warning, successful).
      • Check the box for "Collapsed" for the groups you want to display collapsed.
    4. Set the default view:

      • At the bottom of the view settings page, select the option "Make this the default view" if you want this view to be shown by default when users access the list.
    5. Save the view:

      • Click "OK" or "Save" to save your new view.

    Now, your SharePoint list will be grouped according to the chosen column, and the selected category will be expanded while the other groups will be collapsed.

    Remember that these steps can vary slightly depending on the SharePoint version or environment you are using. However, the overall process should be similar for most SharePoint installations.

    • JFM_12's avatar
      JFM_12
      Iron Contributor
      Hello Lalit Mohan
      Yes but this will collapse the category "Status" with all the 3 settings.
      But the goal is to have one setting to be expanded within this category.
      - successfull should be collapsed
      - warning should be collapsed
      - error should be expanded

      Regards
      JFM_12
      • Lalit Mohan's avatar
        Lalit Mohan
        Iron Contributor
        You are right; the default "Group By" feature in SharePoint doesn't offer the ability to expand one specific group while keeping others collapsed. However, there's a workaround to achieve this using SharePoint's "Accordion" web part to display the list data in an expandable format.

        Here's how you can do it:

        Create your SharePoint list:

        Go to your SharePoint site.
        Click on "Site Contents" and then "New" to create a new list.
        Enter the necessary columns and data for your list items.
        Create a new page:

        Click on "Site Pages" or the appropriate location where you want to add the new page.
        Create a new page and give it an appropriate name.
        Add the "Accordion" web part:

        Edit the newly created page.
        Click on the "+" icon to add a new web part.
        Search for "Accordion" in the web part search bar.
        Add the "Accordion" web part to the page.
        Configure the "Accordion" web part:

        Edit the web part and configure its settings.
        For each accordion item, use the "Group By" value as the header and create a list view with the appropriate filter for that specific group.
        Set the "Status" column as the grouping criterion, and in the filter section, specify "Status" equals "Error" for the item you want to be expanded.
        Save and publish the page:

        Save the changes to the page and publish it.
        Now, when users visit the page, they will see the SharePoint list data displayed in an accordion format, with the "Error" group expanded, and the "Warning" and "Successful" groups collapsed by default.

        Using the "Accordion" web part is a non-programmatic approach to achieve the desired result and doesn't require custom coding. It provides a user-friendly way to display the list data with the specific grouping and expanding behavior you mentioned.

Resources