2

I would like to be able to display list results to users that only contain their name. I have 2 possible ways I think this can be done, but not sure how.

In the Query template section, I have https://site.sharepoint.com/sites/site/Lists/listname/.

But I cant use the URL that has a custom user view. Is this possible? e.g. https://site.sharepoint.com/sites/site/Lists/listname/Current-User.aspx

OR my second choice is using the Refinement filters. I have tried using Title:equals(userName). But does not work. I do have the Title field filled out with the username.

Is it even possible to filter results based on who's logged in? Thanks

4
  • Based on which column you want to filter? created by, modified by or any other custom user column? can you share more detail about your list? Commented Jun 7, 2023 at 10:54
  • More infomation: I have a sharepoint list that contains an entry for every user in the company. I have the username being filled in Title Field. In the PnP sharepoint webpark i only want to display list infomation to the current user that has thier name in it. I don't want other users seeing eachothers fields.
    – Harry
    Commented Jun 7, 2023 at 11:40
  • You can get display name of current user using these tokens: {User} or {User.Name}. Check more information & properties at: microsoft-search.github.io/pnp-modern-search/usage/…. You can use this to match it with your Title column in the list. Commented Jun 7, 2023 at 11:52
  • 1
    Thank you, this worked.
    – Harry
    Commented Jun 7, 2023 at 12:08

1 Answer 1

0

You can get display name of currently logged in user using either of below tokens:

  1. {User} or
  2. {User.Name}.

You can also get the Email and other properties from user profile.

Check more information & available properties at: User Tokens.

You can use these tokens to match it with your Title column in the SharePoint list.

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.