How to get all document library metadata for each file using sp pnp v3+ #2782
Unanswered
cardinalpipkin
asked this question in
Q&A
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to get the custom columns that I've made on a document library so I can filter the files and display them on an SPFX webpart.
This is the util:
export const getFiles = (itemId: number, listName: string, filter) => { return sp.web.getFolderByServerRelativePath(listName).expand('Id,Title,FileRef,FileLeafRef,ENGREF').files(); };
I've also tried just:
return sp.web.getFolderByServerRelativePath(listName).files();
and
return sp.web.getFolderByServerRelativePath(listName).select('Id,Title,FileRef,FileLeafRef,ENGREF').files();
and
sp.web.getFolderByServerRelativePath(listName).listItemAllFields().then(r => { console.log(r, 'r'); });
All return the odata for each of the files, but not the custom column I need. What am I missing? I've read the latest v3 documentation thoroughly: https://pnp.github.io/pnpjs/sp/folders/ and https://pnp.github.io/pnpjs/sp/files
Beta Was this translation helpful? Give feedback.
All reactions