I am pretty new SharePoint. I would like to know if we can use two SPFx extensions in one application. Because i want the functionality of both field customizer and application customizer. And if yes then how can we get the details of a selected file in a library using @pnp/sp.
sp.web.fields.getByTitle("Name").get().then((item)=>{
console.log(item);
});
Code used by me. But it didn't seem to work
Yes, you can use two (or more) SPFx extensions in one SPFx project. Just run the yo @microsoft/sharepoint
generator again, and it will give you the opportunity to add another extension (or web part, even) to the project.
To your second question, if you want to get a SharePoint file, you can use the File or Folder endpoints in @pnp/sp. Here's some documentation. An example:
sp.web.getFileByServerRelativeUrl('/sites/MySite/MyLibrary/MyFile.doc').get().then((file) => {
console.log(file);
})