Sharepoint View (Filter Current User's)


Once you create the new list, you must add columns to the list. You can add new columns to the list by clicking on the List Settings option displayed below. Next click on the “Create Column” link near the bottom of that page.
SharePoint List Settings
Create Column for SharePoint List
One of the columns of the list should be a column to assign the item to either a user or user group. This column is used to implement the filtering.
Next, create a view based on the user/user group column. This option is on the List Settings page below the Columns section.
Create custom view with person (user) & group
You can decide which columns are important for this new view. The most important thing for this example is adding the filter to only show list items that are assigned to the current user. It is also best to make the view the default view for the list at this point. We expand this filter later using SharePoint Designer 2010 to include the current user and any groups that user is in.
Add filter to show only show list items belonging to current user
Once the new view is create, open SharePoint designer and point it to the SharePoint instance that the list is in. Locate the list and select the new filter.
In SharePoint Designer open list and filter
The following code was received from this site (http://www.hornerit.com/2009/07/filtering-by-group-in-sharepoint-person.html). Please note that once you make this modification to the view, you will no longer be able to update it. It is best to make sure that all other settings are set before proceeding with this next step. In order to make any additional modifications to the view, it will have to be deleted and recreated.
Make sure that you are looking at the view in either the split view or the code view. Look for the Where clause in the code. The code should look similar to the following:
Code with Where clause in SharePoint Designer
Update the Where clause to contain the following code. Remember to rename the FieldRefs to the name that was found within your original code.
Update code with this code in SharePoint Designer
Once your changes have been saved, you should be able to view the filtered list based on the user/user group field. Now you have a custom view based on the current user

Comments

Popular posts from this blog

Sites.Selected | Graph API SharePoint Permission

Configure the SharePoint Online App Catalog

Azure Function | Sharepoint List item | Call from Power Automate Flow