The property or field 'Title' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.

g h 716 Reputation points
2020-11-10T01:52:11.37+00:00

Try to get user properties like this:

38623-snipaste-2020-11-10-09-51-25.png

Throw the error below:

sp.runtime.js:2 Uncaught Error: The property or field 'Title' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.

Please help to check if there is any error in code.

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,619 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerryzy 10,571 Reputation points
    2020-11-10T06:07:06.597+00:00

    Hi @g h ,

    Try to load user object in the code snippet:

    var context = new SP.ClientContext.get_current();
    var user = context.get_web().get_siteUsers().getById('22');
    context.load(user);
    context.executeQueryAsync(
    Function.createDelegate(null, ensureUserSuccess),
    Function.createDelegate(null, onFail)
    );


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.