yes, in SPFx you should use SP REST API for fetching list of documents from doclibs - like shown in your example. But what is actual question?
Using SPFX to list the Project Documents
I am new to developing for SharePoint and trying to find the documentation to make a web part to list the project documents. I found documentation and videos for bringing in the project information:
.get(`${this.props.context.pageContext.web.absoluteUrl}/_api/web/lists/GetByTitle('Projects')/Items?$expand=ProjectManager&$select=*,ProjectManager,ProjectManager/EMail,ProjectManager/Title`,
And can filter the list of projects with this:
.get(`${this.props.context.pageContext.web.absoluteUrl}/_api/web/lists/GetByTitle('Projects')/Items?$expand=ProjectManager&$select=*,ProjectManager,ProjectManager/EMail,ProjectManager/Title&$filter=Title eq %27${filterVal}%27`,
Any help is much appreciated.
Thank you
2 answers
Sort by: Most helpful
-
-
MichaelHan-MSFT 18,016 Reputation points
2021-10-22T03:08:00.297+00:00 Hi @Aaron Mina ,
They are two lists. And you only get the items in the Projects list. You also need to get the items from Project Documents list.
In the list Project Documents, the Project column looks like a lookup field. So it 'svalue should be the id in Projects list
The process would be like this: First get the items in Project Documents, and in eachitem use the Project cloumn value to get the specfic item in Projects list.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.