I am trying to query a SharePoint list where I need to pull the last name (title), first name, email, and replacement name by filtering on the last name (title) and first name to make sure we have the correct person.
The request URL:
https://graph.microsoft.com/v1.0/sites/company.sharepoint.com:/sites/samplesiteid:/lists/%7Bsamplelistid7D/items?expand=fields%28select%3DTitle%2CFirstName%2CEMail%2CReplacement_x0020_Name%29&filter=fields%2FTitle%20eq%20%27SQ789%27%20and%20EMail%20eq%20%27Shannon%27&select=id
I get the 500 error:
{
"error": {
"code": "generalException",
"message": "General exception while processing",
"innerError": {
"date": "2023-04-13T18:47:56",
"request-id": "30e04301-a273-4aa0-bd7c-5fdbf9ca842b",
"client-request-id": "30e04301-a273-4aa0-bd7c-5fdbf9ca842b"
}
}
}
This error message is not helpful.
I am able to successfully get all the information when I have only one filter (i.e. Title eq 'SQ789'). As soon as I added the 'and' condition and the filter on the first name, I started getting the error.
Both last name (title) and first name are indexes. There is a full name column in the list, but it is a calculated column. If I could filter this column, that would be ideal but I have not seen any way to do that on a calculated column. I was not able to make it an index.
Based on the documentation, it seems like this should not be a problem, but I have not been able to make it work.
https://graph.microsoft.com/v1.0/sites/company.sharepoint.com:/sites/samplesiteid:/lists/{samplelistid7D}/items?expand=fields(select=Title,FirstName,EMail,Replacement_x0020_Name)&filter=fields/Title eq 'SQ789' and fields/FirstName eq 'Shannon'&select=id
. Let me know if it works for you.