SharePoint ECMAScript: cannot get listItems count

Will 616 Reputation points
2020-12-03T15:27:57.797+00:00

Hi there,

I use ECMAScript to get some information from a List, and I cannot get count of list items. Is there ideas on it? Thanks

44892-untitled.png

44886-1.png

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,422 questions
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,638 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,046 Reputation points
    2020-12-04T02:15:53.813+00:00

    Hi @Will

    In line 72 of your code, change it to clientContext.load(this.listItems). It should work for you.

    45071-image.png


    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.


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.