Hi,
Is there any way to get the library name in the SP.web.getFileByUrl.
I have tried the below code but not getting library name
let result = await sp.web.getFileByUrl("https://sample.sharepoint.com/:p:/r/sites/SampleSite/SampleLibrary/test/test.docx?d=w1db9f77e26354f7e8301ff3ddda7dff0&csf=1&web=1&e=O2hf6u").select("*").get()
Vaibhav ChauhanPosted Jun 15, 2021, 4:24 AM
parthasarathy BPosted Jun 15, 2021, 4:15 AM
Vaibhav ChauhanPosted Jun 14, 2021, 3:11 PM
You can use below code to fetch library details
let libraryDetails = await sp.web.getList(ServerRelativeUrl).select("*").get();
console(libraryDetails.Title) ;