We have list with user email id detail and other project related detail. When the user logs in he should only see list items where his email id exist.

Filter List view (with email id) based on current user email id

2 Answers 2


Option 1: If you can change email id field of list with People and group, then it would serve your purpose without any customization or scripting on page. You can filter view by [Current User]

Option 2: You can use jslink to remove or delete rows where email id does not match with current user.

(function () {
 function listPreRender(renderCtx) {
var rows = renderCtx.ListData.Row;
 var excludeRows=[];
for(var i = rows.length - 1; i >= 0; i--) {
    var emailid = rows[i]["Email Id"];
      if (emailid.indexOf('currentUserEmailID') < 0)
        excludeRows.push(i);//row idexes to be excluded
 for(var i = excludeRows.length - 1; i >= 0; i--) {
    var rowIdx = excludeRows[i];  //get row index to exclude 
    rows.splice(rowIdx, 1);  //delete List View Row
    renderCtx.ListData.LastRow = rows.length;  //update ListData.LastRow property
function registerListRenderer()
var context = {};
context.Templates = {};
context.OnPreRender = listPreRender;
ExecuteOrDelayUntilScriptLoaded(registerListRenderer, 'clienttemplates.js');

Below are 2 options

  1. Use Connected Filter webpart and list view webpart to do the same. Keep email id of user in querystring and use it in webpart to filter data.


  1. Create/write custom code to retrive data from list and show it to user, retrieve email from query string and pass it in CAML query to get only required data and display it on screen.If the email id is same as in active directory which is being stored in list, you can get users'e email id from user properties.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.