0

I make a POST query to /search Graph API, with the following body:

{
    "requests": [    
    {
        "entityTypes": [
            "listItem"
        ],
        "query": {
            "queryString": "*"
        },
        "fields": [
            "bodyPreview",
            "contentclass",
            "contentType",
            "createdBy",
            "createdDateTime",
            "department",
            "description",
            "displayName",
            "end",
            "file",
            "filetype",
            "folder",
            "from",
            "givenName",
            "lastModifiedDateTime",
            "listItemId",
            "name",
            "parentReference",
            "phones",
            "pictureThumbnailURL",
            "refinableString02",
            "replyTo",
            "sender",
            "size",
            "start",
            "subject",
            "surname",
            "title",
            "userPrincipalName",
            "webUrl"
            ]
        }
    ]
}

As a response, I get different listItems from different lists inside my SharePoint tenant.

Is there a way (a field or something) to get into my response the name of the list each item belongs to?

Thanks in advance.

2
  • Try using path property in fields array in request body. It will give you the URL of the list. Let me know if it works for you. Commented Feb 19 at 12:06
  • or use listid to get unique ID (GUID) of the list. Commented Feb 19 at 12:10

1 Answer 1

1

As per my knowledge, there is no managed property available for SharePoint "list name".

However, you can try using path or listid properties in fields array in request body which will give you some information related to your SharePoint list, like:

"fields": [
  "path",
  "listid",
  "title"
]

Example:

enter image description here

1
  • 1
    Thank you so much Ganesh, listid is exactly what I was looking for!
    – caneta
    Commented Feb 19 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.