Forum Discussion
SharePoint List - Group items and leave one category open
- Aug 07, 2023
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)
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:
Create your SharePoint list:
- Go to your SharePoint site.
- Click on "Site Contents" and then "New" to create a new list.
Add your list items:
- Enter the necessary columns and data for your list items.
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.
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.
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_12Aug 07, 2023Iron ContributorHello 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 MohanAug 07, 2023Iron ContributorYou 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.- JFM_12Aug 07, 2023Iron ContributorHello Lalit
Thank you again for your great answer.
Accordion is not available on SharePoint Online Modern Site, or am I wrong?
Thank you
Regards
JFM_12