0

Is there any way to get user logged details report in sharepoint online office 365.Any suggestion would be helpful. Thanks in advance.

  • Do you want to get the details of current user logged in or something else? – Ganesh Sanap Dec 13 '18 at 8:05
2

In SharePoint online, you can get the current logged in user by using this code.

var userID=_spPageContextInfo.userId;
1

Best and simple way to get current logged in user name is _spPageContextInfo.

_spPageContextInfo:

_spPageContextInfo is a global variable usually available on any SharePoint page. This variable stores basic information about current web and current user.

Below are the Some examples:

  1. To Get User Display Name:

    var currentUserName=_spPageContextInfo.userDisplayName;

  2. To Get User Login Name:

    var currentUserLoginName=_spPageContextInfo.userLoginName;

  3. To Get User Id:

    var userID=_spPageContextInfo.userId;

Reference:

  1. Get user logged on sharepoint online

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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