Get data from discussions list in community site sorted by the count of Replies
-
13-01-2021 - |
Pergunta
I have tried both CAML
query and REST API
to retrieve data from the Discussions List in the community site but I am unable to accesss the Replies
column.
How to access this column and sort data?
Please help.
Solução
To get the list of replies
_api/lists/getByTitle('listname')/items?$filter=ContentType eq 'Message'
or
/_api/lists/getByTitle('listname')/items?$filter=FSObjType eq 0
To get the list of Discussions with the replies count:
/_api/lists/getByTitle('listname')/items?$select=ID,Title,Body,Folder/ItemCount &$expand=Folder/ItemCount &$filter=ContentType eq 'Discussion'
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange