No one has responded to this discussion for at least a year, so this information may be out of date. If you're looking for information about this topic, please search for a more recent discussion or post a new question.

Display List items based on User / Group membership

This question is not answered This question is not answered

I've been looking for the best way to display specific list items based on the current user.

I've explored using the Current User filter and Target Audiences.  But both come up short.


We have set up site collections that will be isolated from each other.

Site collection access will be managed by users being part of a corresponding group.

A list called "site collections" will have a list item and URL for each site collection.


  1. All users will land on the parent Team Site when they log in.
  2. A list webpart will display one list item, a URL to their site collection, but will not display links to other site collections in the list. 
  3. The user will click the link in the list item and be directed to their site collection.

Current User Filter didn't work well.  I had to add another column to the list and wanted to put a group name in this column.  But Current User Filter only sends the account name of the logged in user.  It wont send a group name.


Target Audience may work.  But I have to wait up to a week before a newly created audience is compiled.  So this mechanism slows the deployment of a new site collection and group of users for it. 


I'd be very grateful for any suggestions or improvements on what I have tried so far.



All Replies
  • Not quite what you're after but I achieved a similar goal by having users log in at the company's public web site. Since it was a WordPress site it was easy to add a redirect to a specific site and bypass the team site. Users log in and are taken to the 365 log in and seamlessly on to their site. It's really just a way of automating the url they use but works well.     
  • I know audiences won't work for external users (customers that use Live ID) as they don't get indexed, If it's just internal Office 365 users, audiences might be an option.

    Daryl, I think you and our team want the same functionality in a customer landing page hosted 100% on Office 365 :) Do share if your able to leverage the built-in SharePoint functionality without a custom solution to be developed.

  • Thanks for the response mchv. Sound like for your work around, each of your staff needs a Wordpress account.  Im trying to avoid manaing two identities.

    But thank you for your time.

  • Hi John. I'd like to see field in the SharePoint user profile that allows you to assign a users default / home site collection.

    Audiences will work, but the long compilation intervals makes this method impractical.

    We also want a customizable login page to put on corporate branding. But thats a whole other story.  

    I'll share what I find if I manage to resolve my problem.

    Thanks John.

  • Darrell,

    I used the 365 id/password for the WordPress accounts, so users only have to know one log in. All they have to know is to go to the co web site log in page and log in. The rest is "automated". So it's still 2 identities to manage for the admin but easier for the users, which was a requirement for this account.  

  • Well I have a custom solution for this .. a little script on the page can do the trick.

    I did this earlier with a Ribbon button. See my post

    Here is the script

    <script src=”/_layouts/SP.js” type=”text/ecmascript”></script>

    <script type=”text/javascript”>

    // The below is called by EnabledScript in ribbon button

    function EnableIfUserInGroup() {

    var _userInGroup;

    if (UserExistInGroup == null)


    else {

    _userInGroup = UserExistInGroup;

    UserExistInGroup = null;

    return _userInGroup;



    // The below checks if the user exists in the group

    function CheckUser()


    var clientContext = new SP.ClientContext();

    var groupCollection = clientContext.get_web().get_siteGroups();

    // Get the Our Group’s ID

    var _group = groupCollection.getById(10); ->> ID of the Group that we are checking against e.g. ListOwners group

    var users = _group.get_users(); ->> Get all Users of the group



    this._currentUser = clientContext.get_web().get_currentUser(); ->> Get current user


    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));

    RefreshCommandUI(); ->> Refreshes the Ribbon again to pick up the new value for UserExistInGroup


    //The below Checks  if User is the member of the specified group

    function onQuerySucceeded() {

    if(users.count >0)


    UserExistInGroup = false;

    for(var i=0; i < users.count; i++)


    if(users[i].get_loginName() == this._currentUser.get_loginName())


    UserExistInGroup = true;




    function onQueryFailed(sender, args) {

    alert(‘Request failed. ‘ + args.get_message() + ‘\n’ + args.get_stackTrace());



  • Thank you for your input Isha.  I'm trying to avoid using scripts / code, mostly because Im not a programmer.

    I'm going to work more with the Current User Filter.  I'll have to create a list item that has the site collection url and the user account name.  I would have preferred to use SharePoint Groups or Security Groups to manage access to a list item. But I'll just have to add a list item as part of setting up a user.

  • Hi Darrell,

    Thanks for your update. If you have any other questions when using Office 365 in the future, please don't hesitate to contact us.


    Kevin Cui

  • Hi Vik,

    How are the things going?Has this issue been resolved?

    If you have any other questions or concerns, please do not hesitate to contact us.

    Kevin Cui
  • Hello Kevin.

    My work around is acheiving what I want to do.  I'm now working on hiding and securing access to the "Site Collections" list.  I don't want users to see other items in the list.  I want them to only be able to see the list using the web part and current user filter on the landing page.  

    Do you have any suggestions?

    When you click on the "Lists" heading in the Quick Launch bar, it will display all the lists in the site.  

    I want to either, prevent the user from opening the "Site Collections" list, or again, only display items in the list that they have been given permission to access.


    Darrell Webster

  • Hi,

    Have you tried to remove the related permissions for one list item, and then assign the permissions to only one individuall user?


  • Hi Darrell,

    How are the things going?Has this issue been resolved?
    If you have any other questions or concerns, please do not hesitate to contact us.


    Kevin Cui