Using SPFX to list the Project Documents

Aaron Mina 1 Reputation point
2021-10-21T13:58:10.307+00:00

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

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,214 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,598 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,662 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,571 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. sadomovalex 3,626 Reputation points
    2021-10-21T14:37:38.363+00:00

    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?


  2. 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.