SharePoint List item not found when running HTTP query from Logic app

Joost van der Linden 71 Reputation points
2024-04-29T17:00:13.5866667+00:00

Hi everybody,

I am facing an issue with getting a SharePoint list item as described here: https://learn.microsoft.com/en-us/graph/api/listitem-get?view=graph-rest-1.0&tabs=http

When I perform the following query through Graph Explorer, I get a success result and I see the data:

GET v1.0 https://graph.microsoft.com/v1.0/sites/<mytenantname>.sharepoint.com:/sites/<mysitename>:/lists('193eeb25-3617-4ef2-823b-6d29719095e4')/items/131

However, when I try to do this through my Logic app, for which I have enabled the system-assigned managed identity, assigned the Sites.selected Microsoft Graph API permission and assigned the enterprise application write permission to the respective site.

User's image

When I run this query, I get the error message below. But I have no clue why I experience this different behavior in respect to Graph Explorer?

Anyone who can help me out here? Thanks!

"error": {
    "code": "itemNotFound",
    "message": "The specified list item was not found",
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,887 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,768 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,790 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Joost van der Linden 71 Reputation points
    2024-04-30T15:19:06.1033333+00:00

    After some additional testing I found the cause of this behavior.

    I had configured the advanced settings of the list so that users could only read items that they had created themselves, same for editing.

    I found this when performing a GET items query on the list, and an empty array being returned.

    When granting the Enterprise app permissions to the specific SharePoint site, we can only select read or write permissions, and this is insufficient to override the configuration (full control permissions required).

    0 comments No comments

  2. RaytheonXie_MSFT 31,846 Reputation points Microsoft Vendor
    2024-05-01T01:36:33.0566667+00:00

    Hi @Joost van der Linden,

    I'm glad to hear you solve the problem ,if you have any issue about SharePoint, you are welcome to raise a ticket in this forum.

    By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others." and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:

    [SharePoint List item not found when running HTTP query from Logic app]

    Issue Symptom:

    Unable to get sharepoint list item by graph in Logic app. But could get data by postman

    Solution:

    When granting the Enterprise app permissions to the specific SharePoint site, we can only select read or write permissions, and this is insufficient to override the configuration (full control permissions required).


    You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!

    0 comments No comments