Skip to content

Instantly share code, notes, and snippets.

@naveenmaurya
naveenmaurya / tsx
Created May 12, 2020 15:38
Get count of items/files in list/document library in SharePoint Online with SPFx
import { SPHttpClient, SPHttpClientResponse, SPHttpClientConfiguration } from '@microsoft/sp-http';
this.context.spHttpClient.get(`${this.context.pageContext.web.absoluteUrl}/_api/web/AppTiles`, SPHttpClient.configurations.v1)
.then((response: SPHttpClientResponse) => {
response.json()
.then((responseJSON: any) => {
console.log(responseJSON); // Gets all the list and document library details in JSON
})
.catch(error => {
console.log(error);

A rolling red ball in CSS

Well... the title says it all! And yes it's done in CSS.

A Pen by Naveen on CodePen.

License.