In this SharePoint Online tutorial, we will discuss everything on SharePoint Online list views. We will see, how to create a view in SharePoint Online modern list and the following points.
- How to create a view in SharePoint Online List
- How to edit a view in SharePoint Online List
- How to Delete a view in SharePoint Online List
- How to set current view as default view in SharePoint Online list
- SharePoint online list group by
- SharePoint online list filter
- SharePoint online list filter current user
- SharePoint online list filter by date
- SharePoint Online list view examples
- SharePoint Online List View threshold limit
- SharePoint Online List threshold limit increase
- sharepoint 2013 list view filter by query string
If you are new to SharePoint, check out an article on SharePoint Online List.
How to create a view in SharePoint Online List
There are two ways that we can create a view in the SharePoint Online List,
- Create a View in Modern SharePoint
- Create a View in Classic SharePoint
Create a View in Modern SharePoint
- To create a view in SharePoint online list, initially Open the SharePoint list for which you want to create a view.
- Now expand the All items drop down and select the Create new view option.
In the View Name option, enter the view name and choose the view type that you want to create, and under the visibility option, enable the checkbox to make the view public. Select Create option to create a view.
In the below screenshot, you can see the view is created.
If we select the Compact List option, then the List layout displays as below:
If we select the Gallery option, then the List layout displays as below:
This is how we can create a view in the modern SharePoint.
Read SharePoint Online saved for later web part
Create a View in Classic SharePoint
- To create a view in SharePoint online list, open the SharePoint list and then Select the settings gear icon, and click on the List settings.
In the List settings, Under Views select the create view option. It takes you to the page where you can choose the view that you want to create.
Different types of view Styles available in the SharePoint Online
In this example, I am going to choose the Standard view, click on the Standard view, enter the view name and select Ok.
In the below screenshot, you can see the view is created.
This is how we can create a view in the Classic SharePoint.
These are the two ways that we can create a view in the SharePoint Online List either in the Modern SharePoint or in the Classic SharePoint.
Read SharePoint jslink Examples
How to edit a view in SharePoint Online List
- To edit a view in SharePoint online list, initially Open the SharePoint list and then expand the All items drop down and select the Edit Current view option.
In this example, I am going to remove the Issue description column, uncheck the Column, and Select Ok as shown below:
In the below screenshot, you can see that the selected view is updated.
This is how to edit a view in the SharePoint Online List.
Read SharePoint list delete title column
How to Delete a view in SharePoint Online List
- To delete a view in SharePoint online list, initially Open the SharePoint list for which you want to delete a view. Select the settings gear icon, and click on the List settings.
- Open the existing view, that you want to delete.
Now click the Delete Option.
In the Confirmation box, Select Ok to remove or delete the Selected View.
In the below screenshot, you can see that the selected view is deleted.
This is how to delete a view in the SharePoint Online List.
Read SharePoint modern list view customization example
How to set current view as default view in SharePoint Online list
Let us see how to set the current view as the default view in the SharePoint Online modern list.
- Open the SharePoint list that you want to set as a default view, Now expand the All items drop down and select the view that you want to set as default.
- Once the view is selected, expand the view and select the Set current view as the default option.
- It automatically saves and sets the default view.
This is how to set the current view as the default view in the SharePoint list.
Read SharePoint Online location column
SharePoint online list group by
Let us see how to implement the group by feature in SharePoint Online modern list.
- Open the SharePoint list and select the Column that you want to apply Group by functionality.
- Once you modified you can see the asterisk symbol on the default view dropdown down.
In this example, I grouped the employees based on the EmployerrRole. Now you can see the asterisk symbol is presented in the All items.
- Now expand the All items drop down and select the Save view as an option to save changes or to create a new view.
- Click on the Save button and the view will be saved.
This is how, we can implement group by functionality in modern SharePoint Online.
Read SPFx – Bind dropdown list from SharePoint list using PnP
SharePoint online list filter
Let us see how we can use filtering in the modern SharePoint Online List,
Filter action performs based on the selection, it displays the data that matches with the filter applied.
There are two ways that we can apply filters in the Modern SharePoint online list,
- By selecting Column Filter by option
- By selecting Filters Pane
By selecting Column Filter by option
- Open the SharePoint list and select the Column that you want to apply Filter functionality.
- Once you modified you can see the asterisk symbol on the default view dropdown down.
In this example, I am going to filter the employees based on the EmployerrRole where I have added the EmployeerRole column as a data type of Choice column in the SharePoint Online List
In the Filer by properties pane, Select the Role that you want to filter and click on the Apply button, it filters and displays the data in the SharePoint online list.
- Once the filter is applied, you can see the Filter symbol available in the filter applied column. Now you can see the asterisk symbol is presented in the All items.
- Now expand the All items drop down and select the Save view as an option to save the changes.
This is one way that we can apply filters in the Modern SharePoint online list,
By selecting Filters Pane
- Open the SharePoint list and Select the Filters Pane Icon.
- And choose the column name that you want to apply a filter, Enable the check box to apply a filter, it filters and displays the matching results in the SharePoint online list.
- In this example, I am going to filter the employees based on the EmployerrRole. In the below screenshot, you can see that it displays the data for the applied filters.
- We can also clear filters by selecting the Clear Filter icon.
- Now expand the All items drop down and select the Save view as an option to save the changes.
This is another way that we can apply filters in the Modern SharePoint online list
These are the two ways that we can apply filters to the modern SharePoint Online list.
SharePoint online list filter current user
Let us see how we can apply the Filters for People Picker column in the Modern SharePoint Online list,
- Open the SharePoint list and choose the people picker column name to which you want to apply a filter.
In this example, I have added the EmployeesName column as a data type of person or group in the SharePoint Online List.
- Either you can select the Column and choose Filter by option, or you can directly open the Filters Pane to apply filters.
In the Filter by properties pane, If you Filter by @Me it filters and displays matched results for the logged-in user.
- In the below screenshot, you can see it filters and display the results for the logged-in User.
- Now expand the All items drop down and select the Save view as an option to save the changes.
Example to filter in the Filters Pane
- In the below screenshot, you can see that I have filtered based on the two EmployessName in the Filters Pane and it also filters and displays the data for the selected users.
- Now expand the All items drop down and select the Save view as an option to save the changes.
This is how to apply the Filters for People Picker column in the Modern SharePoint Online list.
Let us see how we can filter the SharePoint online list view by the current user,
- Yes, it is possible to filter the items in the SharePoint online list view by the current user.
- Make sure, the column is created as a person or group column only then you can able to apply the filter based on the current user.
Follow the below steps to filter the SharePoint List view by the current user:
- Open the SharePoint list for which you want to apply the filter based on the current user, Select the Person or group column and apply the filter by option.
- Else, select the filter icon available in the SharePoint online list toolbar.
- Now select the @Me option available in the filter section, it filters and displays matched results for the logged-in user.
- We can also see the list items count in the Filters properties pane.
In this example, the logged-in user name is called Roselin, so it filters and displays the items based on the current user in the SharePoint Online list.
This is how we can filter the SharePoint online list view by the current user.
SharePoint online list filter by date
Let us see how we can apply the Filters for Date Picker Column in the Modern SharePoint Online list
- Open the SharePoint list and choose the Date picker column name to which you want to apply a filter.
In this example, I have added the StartDate and EndDate columns as a data type of Date and time in the SharePoint Online List.
- Either you can select the Column and choose Filter by option, or you can directly open the Filters Pane to apply filters.
In the Filter by properties pane, Select the date that you want to filter by it filters and displays matched results.
- In the below screenshot, you can see it filters and display the results for the selected date.
- Now expand the All items drop down and select the Save view as an option to save the changes.
Example to filter in the Filters Pane
- In the below screenshot, you can see that I have filtered the EndDate empty values in the Filters Pane and it also filters and displays the data which has empty values in that Column.
- We can also Reset the value, that we selected, and also we can select specific dates that we want to display.
- Now expand the All items drop down and select the Save view as an option to save the changes.
This is an example of a sharepoint online list filter by date.
SharePoint Online list view examples
Here are a few examples of the SharePoint Online list view.
SharePoint Online List Group by Month
Let us see how we can group the Modern SharePoint Online list items based on the month,
Yes, it is possible to group the SharePoint online list items based on the Month using group by functionality.
Follow the below steps to group list items based on the Month:
- Open the SharePoint Online list -> Select the settings gear icon and click on the List settings.
- On the list settings page, Select Create column option under the Columns.
- Make sure, you have created a Date and time type column in your SharePoint list. Only then we can calculate the Month, based on the other columns of type date and time.
- On the Create Column page, Enter the Column Name and Choose the Datatype of the column as the calculated Column.
- Now Under the Formula section, enter the formula mentioned below, so that it will group the column based on the Month, insert the other columns of type date and time.
- In this example, I have inserted the StartDate column from the SharePoint list of type date, and time.
- Scroll down and click on the Ok button to create a column successfully.
=TEXT(StartDate,"mm (mmm)")
- Now you can see the Month Column is created in the SharePoint Online list, and it calculates and displays the month based on the StartDate Column.
- Here you can Group the SharePoint online list items based on the Month. For that, expand the Month Column and Select the Group by Month option, it will group the list items based on the Month.
- In the below screenshot, you can see that the SharePoint Online list items are grouped by Month. We can also able to see the SharePoint Online list items count.
- This is how we can group the Modern SharePoint Online list items based on the Month.
SharePoint Online List group by year
Let us see how we can group the Modern SharePoint Online list items based on the Year,
Yes, it is possible to group the SharePoint online list items based on the Year using group by functionality.
Follow the below steps to group list items based on the Year:
- Open the SharePoint Online list -> Select the settings gear icon and click on the List settings.
- On the list settings page, Select Create column option under the Columns.
- Make sure, you have created a Date and time type column in your SharePoint list. Only then we can calculate the Year, based on the other columns of type date and time.
- On the Create Column page, Enter the Column Name and Choose the Datatype of the column as the calculated Column.
- Now Under the Formula section, enter the formula mentioned below, so that it will group the column based on the year, insert the other columns of type date and time.
- In this example, I have inserted the StartDate column from the SharePoint list of type date, and time.
- Scroll down and click on the Ok button to create a column successfully.
=TEXT(StartDate,"yyyy")
Now you can see the Year Column is created in the SharePoint Online list, and it calculates and displays the Year based on the StartDate Column.
- Here you can Group the SharePoint online list items based on the Year. For that, expand the Year Column and Select the Group by option, it will group the list items based on the Year.
- In the below screenshot, you can see that the SharePoint Online list items are grouped by Year. We can also able to see the SharePoint Online list items count.
This is how we can group the Modern SharePoint Online list items based on the Year.
SharePoint Online List View threshold limit
- The SharePoint Online List view threshold limit is 5000, which cannot be extended.
- Even though a SharePoint Online list can store a maximum of 30 million items, we cannot display more than 5000 items at once, when the List tries to display more than 5000 items a threshold error occurs.
SharePoint Online List threshold limit increase
- No, it is not possible to increase the SharePoint Online list threshold limit value.
- We cannot change the default SharePoint Online list view threshold value. But it is possible to increase the threshold value in the SharePoint on-premise versions from the SharePoint central admin. or by using PowerShell.
SharePoint online custom list view style
Let us discuss, a sharepoint list view style and how to change the default list view style using CSS in SharePoint Online/2013/2016/2019. The list view style will work only in classic SharePoint sites, not in the modern SharePoint sites.
We can write the CSS code inside a script editor web part in the list view page in SharePoint.
Open the SharePoint site and go to the list view page. Then edit the page and add a script editor web part in the list view page. Then paste the below code in the script editor web part.
<style type="text/css">
/* List View Header */
.ms-listviewtable > thead > tr > th {
background-color: #5B9BD5;
}
/* List view Header Text color*/
.ms-vh-div, .ms-headerSortTitleLink {
color:white!important; font-weight: bold;
}
/* background color for alternate rows */
.ms-listviewtable > tbody > tr.ms-alternating {
background: #e1eaf4}
}
</style>
Once you save the code and refresh the page, now you can see the default list view will have a custom header which was by just using the CSS code.
This is how to implement the list view style using CSS in SharePoint Online.
SharePoint freeze column headers
Let us see how to freeze column headers in the SharePoint list view. This will work in classic SharePoint lists. We will see, how to freeze header row in SharePoint 2013 list view on scroll using jQuery.
If you have more items in a list view then scroll will appear and once you scroll below the header column disappears like below in SharePoint.
So my requirement was to freeze the header row in the view, so that when a user scrolls, the user can see the header row in the list view in SharePoint.
Now, we will see how we can implement jQuery to have a fixed list view header row in SharePoint Online or SharePoint 2013/2016/2019.
Open the SharePoint list view page in the browser and then edit the page. Then add a script editor web part to it and insert the below code.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
stickyHeaders()
})
function stickyHeaders(){
if( jQuery.inArray( "spgantt.js", g_spPreFetchKeys ) > -1){
SP.SOD.executeOrDelayUntilScriptLoaded(function () {
findListsOnPage();
}, "spgantt.js");
} else {
findListsOnPage();
}
$(window).bind('hashchange', findListsOnPage);
}
function findListsOnPage() {
var lists = $('.ms-listviewtable')
var quickEditLists = [];
var listViews = [];
$(lists).each(function(i){
if($(this).find('div[id^="spgridcontainer"]').length > 0 ){
quickEditLists.push($(this))
} else if( $(this).hasClass("ms-listviewgrid") == false ) {
listViews.push($(this))
}
})
if(quickEditLists.length > 0) {
SP.GanttControl.WaitForGanttCreation(function (ganttChart) {
initializeStickyHeaders(quickEditLists, "qe");
});
}
if(listViews.length > 0) {
initializeStickyHeaders(listViews, "lv");
}
}
function initializeStickyHeaders (lists, type) {
var top_old = [], top_new = [],
bottom_old = [], bottom_new = [],
stickies = [], headers = [],
indexOffset = 0 ;
var style = "position:fixed;" +
"top:65px;" +
"z-index:1;" +
"background-color:beige;" +
"box-shadow:3px 3px 5px #DDDDDD;" +
"display:none"
$(window).unbind('resize.' + type);
$(window).bind ('resize.' + type, updatestickies );
$('#s4-workspace').unbind('scroll.' + type);
$('#s4-workspace').bind ('scroll.' + type, updatestickies );
$(lists).each(function(){
headers.push($(this).find($('.ms-viewheadertr:visible')))
});
$(headers).each(function (i) {
var table = $(this).closest("table");
if(table.find("tbody > tr").length > 1) {
table.parent().find(".sticky-anchor").remove()
table.parent().find(".sticky").remove()
var anchor = table.before('<div class="sticky-anchor"></div>')
stickies.push($(this).clone(true,true).addClass("sticky").attr('style', style).insertAfter(anchor))
var tbodies = $(this).parent("thead").siblings("tbody")
if(tbodies.length > 1) {
tbodies.bind("DOMAttrModified", function(){
setTimeout(function(){
$('#s4-workspace').trigger("scroll", true)
}, 250)
})
}
} else {
headers.splice(i-indexOffset,1)
indexOffset++;
}
})
//Do it once even without beeing triggered by an event
updatestickies();
function updatestickies (event, DOMchangeEvent) {
$(headers).each(function (i) {
if(DOMchangeEvent) {
width();
return false;
}
function width() {
stickies[i].width(headers[i].width()).find('th').each(function (j) {
$(this).width(headers[i].find('th:nth-child(' + (j+1) + ')').width())
})
}
top_old[i] = top_new[i]
top_new[i] = Math.round($(this).offset().top – 45)
bottom_old[i] = bottom_new[i]
bottom_new[i] = Math.round(top_new[i] – 30 + $(this).closest('table').height())
stickies[i].offset({
left: Math.round(headers[i].closest("div[id^=WebPartWPQ]").offset().left)
});
if(top_old[i] >= 0 && top_new[i] <= 0 ||
bottom_old[i] <= 0 && bottom_new[i] >= 0 ||
top_old[i] === undefined && bottom_old[i] === undefined && top_new[i] < 0 && bottom_new[i] > 0 ) {
width();
stickies[i].fadeIn();
} else if (top_old[i] <= 0 && top_new[i] >= 0 || bottom_old[i] >= 0 && bottom_new[i] <= 0 ) {
stickies[i].fadeOut();
}
})
}
}
</script>
After that the header row will appear like below:
This is how to freeze columns in SharePoint Online list.
SharePoint 2013 list view filter by query string
Let us check an example of the sharepoint 2013 list view filter by query string.
In SharePoint, by default when you open AllItem.aspx page for any list or library it will come like below:
http://servername/Lists/MyTestingList/AllItems.aspx
But you can do some more advanced filtering by passing, field, and value in the browser as a query string parameter in the SharePoint list.
Syntax:
?FilterField1=[Internal Field Name]&FilterValue1=[Value to filter]
Let us say I have a SharePoint list that has two fields/columns as Title and Country like below:
Now to filter the list items based on query string we can write URLs like
/Lists/MyTestingList/AllItems.aspx?FilterField1=Country&FilterValue1=IN
Your URL looks like the below:
Here FilterField1 is to give the Column name and FilterValue1 is the value to filter. Here you can use operators like:
=,!=,>,< etc.
Or you can also write like below:
?FilterField1=Country&FilterValue1=IN&FilterOp1=eq
The results will appear as below:
SharePoint List Item Query String Filter on Multiple Values
If you want to filter on multiple values then you can pass values separated by a semicolon(;). See like below:
?FilterName=Country&FilterMultiValue=IN;SL
The URL Looks like the below:
Here we are trying to filter records whose Country is IN and SL. So the results will appear like below:
Remember here the filter column name is the internal name of the column, not the display name.
You can add up to 10 FilterField and FilterValue like below:
/Lists/MyTestingList/AllItems.aspx?FilterField1=Country&FilterValue1=IN&FilterField2=Title&FilterValue2=Item-2……
SharePoint List Item Query String Filter on wildcard characters
You can also filter SharePoint list items filter items based on wildcard characters like below:
/Lists/MyTestingList/AllItems.aspx?FilterName=Country&FilterMultiValue=*IN*
SharePoint 2013 List View Filtering with Query String
Now let us see how to filter records based on a query string parameter in the SharePoint 2013 list view. We implement list view filtering with the query string by using Filter condition, SharePoint designer, etc.
SharePoint 2013: List View Filtering with Query String
Here I have a test list on the SharePoint site, which has two columns Title and Country. We are trying to filter based on query string parameters for the column Country in the list.
First Create a list view. In that new view go to the Filter section and give the condition as Country is equal to {Parm1} which will look like below:
Now if you will try to pass in the query string nothing will come because we have to modify something in the view through the SharePoint designer 2013.
http://win-pfcp2dgt8di/sites/EnjoySharePoint/Lists/MyTestingList/MyTestView.aspx?Parm1=IN
Now open your list view using SharePoint 2013 designer. If you will check the View section, you will see something like the below:
<Query><Where><Eq><FieldRef Name="Country"/><Value Type="Text">{Parm1}</Value></Eq></Where></Query>
We need to add this parameter to the <ParameterBindings> list.
In the <ParameterBindings add the below tag before </ParameterBindings>
<ParameterBinding Name="Parm1″ Location="QueryString(Parm1)" DefaultValue=""/>
This will look like below:
Now Save the view and then if you will pass the value in the query string parameter like below:
http://win-pfcp2dgt8di/sites/EnjoySharePoint/Lists/MyTestingList/MyTestView.aspx?Parm1=IN
The results will appear like below:
This is how to filter items using query string in SharePoint Online list.
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.
This is quite useful for novice like me. I could setup the filter records based on a query string parameter in SharePoint Online. However, it is working only in the Classic view and not when the modern view is on which is default in SPO. Is there no way to implement parameter based query string filtering in modern view?