Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Graph JS
>
Tutorial
> Get lists in a site
The following example shows you how to get the collection of lists for a site.
import { GraphClient } from '../independentsoft/graph/graph.js'; async function mainFunc() { try { const client = new GraphClient(); client.clientId = "xxxxxxxxxx-209e-454e-xxxxxxxxxxxxxxxxxxx"; client.tenant = "independentsoft.onmicrosoft.com"; client.username = "info@independentsoft.onmicrosoft.com"; client.password = "password"; const lists = await client.getLists("independentsoft.sharepoint.comxxxxxxx"); for (let i = 0; i < lists.length; i++) { console.log("Id = " + lists[i].id); console.log("Name = " + lists[i].name); console.log("DisplayName = " + lists[i].displayName); console.log("CreatedTime = " + lists[i].createdTime); console.log("WebUrl = " + lists[i].webUrl); console.log("---------------------------------------"); } } catch (e) { console.error(e.code) //error code console.error(e.message) //description console.error(e.date) //timestamp console.error(e.innerError) //innerError } } mainFunc();
Need help? Ask our developers:
Name*
Email*
Message*