How to use Microsoft Graph API to read from a view that a user created from a list?

Karin van der Bom 21 Reputation points
2021-12-16T10:10:26.517+00:00

With the Microsoft Graph API, I am able to navigate to the list which is on the Sharepoint site. For example my list contains 5 columns. Now, I created a view based on that list with 3 columns on it. When using the API, I can only retrieve the information which is based on the actual list and not on the created View. How can I state in a way that the API will retrieve the information from the created view instead of the list? I tried looking on the internet, but can't find any answer on this.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,019 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,561 questions
0 comments No comments
{count} votes

Accepted answer
  1. JanardhanaVedham-MSFT 3,536 Reputation points
    2021-12-17T09:10:59.843+00:00

    Hi @Karin van der Bom ,

    Currently, there is no Microsoft Graph API available to fetch either list views or a secific list view of a SharePoint Online site.

    At present , the list items can be fetched for the required columns at list level using the below Graph API :

    GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields(select=Column1,Column2,Column3)  
    

    Please refer this documentation on Get List Items API for more information.

    You can submit this feature request idea using this support link, which will be monitored by Microsoft team and make the enhancements to Graph API.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    2 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,811 Reputation points
    2021-12-17T09:21:06.09+00:00

    Hi @Karin van der Bom
    Through my test, I navigated to list which is on the Sharepoint site. And created several views with different columns. And I could retrieve all the columns on the list by using the Graph API,
    but I couldn't retrieve there columns individually from each created view. Based on my understanding of the Graph, the official document only provides some simple operations to get columns and using query parameters doesn't apply in this case. Maybe this is an area that needs improvement, you can submit a user voice to add a support request for reading from a view that a user created from a list, and I'll vote for you.


    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.


  2. Karin van der Bom 21 Reputation points
    2021-12-20T10:28:13.137+00:00

    At the moment, this is not being supported at microsoft graph for reading data from a created view based on a list at Sharepoint.

    0 comments No comments

  3. Ciprian Oltean 20 Reputation points
    2023-11-17T15:23:55.55+00:00

    Hello,

    I would like to know if this is still unsupported by microsoft graph.

    If it is I want to understand how to use graph API to get available views and later to query a specific view.

    Thank you in advance.