Skip to main content
added 40 characters in body
Source Link

You can get logged in user by a GET request.

$.ajax({
        async: false,
        headers: { "accept": "application/json; odata=verbose" },
        method: "GET",
        url: formCtx.webAttributes.WebUrl + "/_api/web/CurrentUser",
        success: function (data) {
            currentUser = data.d;
        }
    });

Now use currentUser in your CSR code. You may omit async if you can handle it properly.

_spPageContextInfo.userLoginName will give you the current user alsouser's login name. So you can use it inside your CSR code if you need the login name only.

You can get logged in user by a GET request.

$.ajax({
        async: false,
        headers: { "accept": "application/json; odata=verbose" },
        method: "GET",
        url: formCtx.webAttributes.WebUrl + "/_api/web/CurrentUser",
        success: function (data) {
            currentUser = data.d;
        }
    });

Now use currentUser in your CSR code. You may omit async if you can handle it properly.

_spPageContextInfo.userLoginName will give you the current user also. So you can use it inside your CSR code.

You can get logged in user by a GET request.

$.ajax({
        async: false,
        headers: { "accept": "application/json; odata=verbose" },
        method: "GET",
        url: formCtx.webAttributes.WebUrl + "/_api/web/CurrentUser",
        success: function (data) {
            currentUser = data.d;
        }
    });

Now use currentUser in your CSR code. You may omit async if you can handle it properly.

_spPageContextInfo.userLoginName will give you the current user's login name. So you can use it inside your CSR code if you need the login name only.

added 111 characters in body
Source Link

You can get logged in user by a GET request.

$.ajax({
        async: false,
        headers: { "accept": "application/json; odata=verbose" },
        method: "GET",
        url: formCtx.webAttributes.WebUrl + "/_api/web/CurrentUser",
        success: function (data) {
            currentUser = data.d;
        }
    });

Now use currentUser in your CSR code. You may omit async if you can handle it properly.

_spPageContextInfo.userLoginName will give you the current user also. So you can use it inside your CSR code.

You can get logged in user by a GET request.

$.ajax({
        async: false,
        headers: { "accept": "application/json; odata=verbose" },
        method: "GET",
        url: formCtx.webAttributes.WebUrl + "/_api/web/CurrentUser",
        success: function (data) {
            currentUser = data.d;
        }
    });

Now use currentUser in your CSR code. You may omit async if you can handle it properly.

You can get logged in user by a GET request.

$.ajax({
        async: false,
        headers: { "accept": "application/json; odata=verbose" },
        method: "GET",
        url: formCtx.webAttributes.WebUrl + "/_api/web/CurrentUser",
        success: function (data) {
            currentUser = data.d;
        }
    });

Now use currentUser in your CSR code. You may omit async if you can handle it properly.

_spPageContextInfo.userLoginName will give you the current user also. So you can use it inside your CSR code.

Source Link

You can get logged in user by a GET request.

$.ajax({
        async: false,
        headers: { "accept": "application/json; odata=verbose" },
        method: "GET",
        url: formCtx.webAttributes.WebUrl + "/_api/web/CurrentUser",
        success: function (data) {
            currentUser = data.d;
        }
    });

Now use currentUser in your CSR code. You may omit async if you can handle it properly.